How to closed window form

i m creating form. by default maximize, minimize, and closed button are present.
when i m click on closed, it will not work. how to do that, when i m click on closed button then it will be activated.
give me suggestion.

hi '
is it posiible to dislpay .pdf, .doc file through form, if yes then how?

Similar Messages

  • How To Export Windows Forms Multiple DataGridViews in single PDF using iTextSharp, C#

    Hi,
    I am using VS2010 For my windows application dash board is required for that i am using 6 datagridview to display in form and i want to export all datagridviews to one single pdf please help me out.
    How To Export Windows Forms Multiple DataGridViews in single PDF using iTextSharp, C#
    Thanks in advance

    Hi friend,
    Actually iText is a third party library to create PDF originally written for java. iTextSharp is the C# adaptation of that library.
    Question regarding iText are better asked on the iText forum, but this is Microsoft Forum:
    http://itextpdf.com/support
    But I am found a similar thread, it may help you.
    http://www.codeproject.com/Questions/442171/How-to-convert-datagridview-to-pdf-in-csharp
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get windows form object of a MMC snapin node using MMC automation object model

    Hello,
    I am using automation object model for an existing mmc file and just trying to traverse all nodes of it. And i am able to do so.
    My query is : how can i get the access of windows form object of a particular node . Windows form is present in result pane of a node, i want to get access of that so that i can perform some automation on that form.
    http://msdn.microsoft.com/en-us/library/aa815049(v=vs.85).aspx
    I found that if OCX control is in result view of any node, then "view object -> control object property" returns
    the automation interface supplied by the control in the result view. 
    However, if result view is HTML view then how to get the automation interface of that result
    view.
    Thanks in advance,
    Sumit

    Hi Sumit,
    I read the link you provide above. It seems that when you want to achieve your target by using MMC automation
    object model, you need to use codes. Based on the programming language, if use VB, I suggest you post the question in
    VB Forum. If you want to use C#, may post in
    C# Forum.
    In addition, there is an answered question, may help you to find the correct forum.
    MMC development forum?
    http://social.microsoft.com/Forums/en-US/3796a8e9-674e-4da0-a40e-4e4b69575c8e/mmc-development-forum?forum=whatforum
    Since, it’s more related to development. We may can’t provide some more detailed information. Thanks for your
    understanding.
    Hope this helps.
    Best regards,
    Justin Gu

  • How to show windows form in SAP B1

    Hi
    I would like to create interface UI form using C# , windows form and add to SAP B1. I would like to know process and send me if you have any sample code please.
    Thanks
    rl

    Hi ragno liver.
    This are the step to create your addon. :
    1- On the menu bar access projects then properties and on Debug you will find the Command line add the following:
    0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
    2- Add References SAPbouiCOM and SAPbobsCOM
    3- Add a module call SubMain to your project
    4- Go to project properties then to the application and then uncheck Enable Application framework. And select SubMain on the starud object.
    5- On the SubMain module add this code:
    using System;
    using System.Windows.Forms;
    class SubMain {
    static void Main() {
    // Creating an object
    MyClase oMyClase = null;
    oMyClase = new MyClase();
    // Start Message Loop
    System.Windows.Forms.Application.Run();
    Where MyClase are located the code to create your menu and the call to your form.
    Regards,
    Jose

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to implement two way databinding in windows form c#

    suppose my win form has textboxes, listbox, dropdown, radio button and check box. now i want to bind those control and whenever data will be changes from out side then change should be reflected in control level. how to achieve it in winform. help me with
    a small working sample code. thanks

    Hello,
    If using SQL-Server look at using SQL Dependency class to get notified of changes outside of your application say by another app or from even SQL Server Management Studio
    https://www.google.com/search?q=sqldependency+example&sourceid=ie7&rls=com.microsoft:en-US:IE-SearchBox&ie=&oe=&rlz=&safe=active&gws_rd=ssl
    Sorry I don't have a working example but perhaps the following might provide a clue into what is needed. I am only using a DataGridView but this could be expanded to other controls. There is a good deal of preparation and work internally to have this working
    right when considering all scenarios
    Form code
    namespace FrontEnd_CS
    /// <summary>
    /// Provides the basics to listen to a database table operations, see also the
    /// Readme file in the Solution Items
    /// </summary>
    /// <remarks>
    /// DgvFilterManager is a third party component that permits right-click a column header
    /// in a DataGridView and do filtering on one or more columns
    /// </remarks>
    public partial class Form1 : Form
    private BindingSource bs = new BindingSource();
    private Customers CustomerData = null;
    public Form1()
    InitializeComponent();
    try
    SqlClientPermission perm = new SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted);
    perm.Demand();
    catch
    throw new ApplicationException("No permission");
    public void OnNewMessageFromServer()
    ISynchronizeInvoke iSyncInvoke = (ISynchronizeInvoke)this;
    // Check if the event was generated from another thread and needs invoke instead
    if (iSyncInvoke.InvokeRequired)
    Customers.NewMessage messageDelegate = new Customers.NewMessage(OnNewMessageFromServer);
    iSyncInvoke.BeginInvoke(messageDelegate, null);
    return;
    // If not coming from a seperate thread we can access the Windows form controls
    LoadCurrentData();
    private void LoadCurrentData()
    DataGridView1.DataSource = null;
    bs.DataSource = CustomerData.GetMessages();
    DataGridView1.DataSource = bs;
    DataGridView1.ExpandColumns();
    bindingNavigator1.BindingSource = bs;
    private void Form1_Load(object sender, EventArgs e)
    CustomerData = new Customers();
    CustomerData.OnNewMessage += OnNewMessageFromServer;
    LoadCurrentData();
    Support code
    namespace BackEnd_CS
    public class Customers
    private static string ConnectionString = "Server=.\\SQLEXPRESS;Trusted_Connection=True;Initial Catalog=CustomerDatabase";
    private SqlConnection Connection = null;
    public delegate void NewMessage();
    public event NewMessage OnNewMessage;
    public Customers()
    // Stop an existing services on this connection string just be sure
    SqlDependency.Stop(ConnectionString);
    // Start the dependency, User must have -- SUBSCRIBE QUERY NOTIFICATIONS permission
    // Database must also have SSB enabled -- ALTER DATABASE CustomerDatabase SET ENABLE_BROKER
    SqlDependency.Start(ConnectionString);
    // Create the connection
    Connection = new SqlConnection(ConnectionString);
    ~Customers()
    SqlDependency.Stop(ConnectionString);
    /// <summary>
    /// Retreive messages from database via conventional SQL statement
    /// </summary>
    /// <returns></returns>
    /// <remarks></remarks>
    public DataTable GetMessages()
    DataTable dt = new DataTable();
    try
    // Create command
    // Command must use two part names for tables
    // SELECT <field> FROM dbo.Table rather than
    // SELECT <field> FROM Table
    // Do not use
    // FROM [CustomerDatabase].[dbo].[Customer]
    // Use
    // FROM [dbo].[Customer]
    // Query also can not use *, fields must be designated
    SqlCommand cmd = new SqlCommand("SELECT [Identifier],[CompanyName],[ContactName],[ContactTitle] FROM [dbo].[Customer]", Connection);
    // Clear any existing notifications
    cmd.Notification = null;
    // Create the dependency for this command
    SqlDependency dependency = new SqlDependency(cmd);
    // Add the event handler
    dependency.OnChange += OnChange;
    // Open the connection if necessary
    if (Connection.State == ConnectionState.Closed)
    Connection.Open();
    // Get the messages
    dt.Load(cmd.ExecuteReader(CommandBehavior.CloseConnection));
    catch (Exception ex)
    throw ex;
    return dt;
    /// <summary>
    /// Handler for the SqlDependency OnChange event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void OnChange(object sender, SqlNotificationEventArgs e)
    SqlDependency dependency = sender as SqlDependency;
    // Notices are only a one shot deal so remove the existing one so a new one can be added
    dependency.OnChange -= OnChange;
    // Fire the event
    if (OnNewMessage != null)
    OnNewMessage();
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions.

  • How to add entire new row at the top of table in pdf report from c# windows forms using iTextSharp

    Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
    First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Text;
    using System.Data;
    using System.IO;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    namespace DRRS_CSharp
    public partial class frmPDFTechnician : Form
    public frmPDFTechnician()
    InitializeComponent();
    private void btnExport_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    PdfPTable inner = new PdfPTable(1);
    inner.WidthPercentage = 115;
    PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
    inner.AddCell(celt);
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(inner);
    doc.Add(table);
    doc.Close();
    The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
    But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
    Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
    given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    So my question is how to make my column headers in bold?
    So these are my questions.
    1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?
    I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
    Any help or guidance in solving this problem would be greatly appreciated.
    vishal

    Hi,
    >>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?<<
    I’m sorry for the issue that you are hitting now.
    This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
    http://sourceforge.net/projects/itextsharp/
    Thanks for your understanding.
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Clear all the data of open windows form of another exe?

    Hi,
    I want to make utility which will clear all the data from one windows application.
    i know the application name. The application of which data i want to clear is made in C# and contains many windows forms and controls.
    out of that opened windows form and controls inside it need to be cleared.
    Please guide on how to do this in C#?

    Short version: Find the window and send it a message with
    SendMessage.
    Open up Spy++ and find your form's window.  You will see that the window has children and they have classes of the form "WindowsForms10.EDIT.*"  Those are TextBox controls.  You can call things like SetWindowText to set the
    text of the window to clear it.
    To do this programmatically, you'll have to obtain the window hand that corresponds to the control.  You can find windows with
    FindWindowEx or
    EnumWindows.  Locate the window by name or class or whatever else you can determine about it.  Find the child windows and "clear" them however you wish.  I assume you mean to set empty strings to all the TextEdit controls. If you
    intend to do something more sophisticated than that, then you'll have to be more specific about what you mean by "Clear all the data".
    It may or may not be obvious that you'll be poking around with Win32 API calls via PInvoke to accomplish much of this. Example:
    SetWindowText via PInvoke.

  • How to create a setup for window form application including the related sql database?

    i have created a simple window form application project that have only 2 form..
    1st one for login in which it'll check the userid n password from database.if both are correct then it will go to 2nd form.
    now i want this project to run in another computer.
    i created a setup file but its showing some error regarding the database instances connection..
    so if anyone can tell me in details how to create the setup file then it'll b a great help..
    thanx in advance..

    Hi,
    Consider the above scenario,I suggest you to use the SQL Server Compact+ ClickOnce Deployment, A Compact SQL database is a file that can be bundled with your application installation. Below is a link guiding you through the creation process of a SQL Compact
    database.
    http://technet.microsoft.com/en-us/library/ms173009.aspx
    The following link discusses setting up the necessary dependencies and prerequisites for SQL Server Compact. (Note, you will need to scroll to the section entitled Private File–Based Deployment.)
    http://msdn.microsoft.com/en-us/library/aa983326(v=VS.100).aspx
    A ClickOnce Deployment can help you publish your application attach compact SQL database into client machine.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I enter a data to B1 form via windows form?

    I'm trying to add the data from a windows form, to the SAP B1 form (e.g. Sales order), now i'm just trying 1 component only which is the CustCode.
    I've been thinking about this but i can't figure it out like how's the structure of the class I should create...
    In my VBproj (VS_2005), i have a simple form (just "TextBox1" and "Button1"), then I have a class "appending.vb":
    Option Strict Off
    Option Explicit On
    Public Class appending
        Public oItem As SAPbouiCOM.Item
        Public oTextbox As SAPbouiCOM.EditText
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private Sub SetApplication()
            Dim SboGuiApi As New SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            SboGuiApi.Connect(sConnectionString)
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
        End Sub
    End Class
    and also Form1.vb class:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim oappend As New appending
            If oappend.oitem.UniqueID = 4 Then
                oappend.oitem.String = TextBox1.Text
            End If
        End Sub
    End Class
    Note that unique ID 4 is because i searched in the system information (CtrlSfihtD) that the customerID in the sales order form has the Item = 4, which is the unique ID, but this property is readonly prop, so that I can't directly instruct to append the data from textbox1 to the item where unique ID is 4 (..UniqueID = 4..)
    I know my code just wont work at all, but i'm really have no more idea about this....
    critics, comment and idea please...
    Thanks,
    Martin

    Dear Martin,
    I think String property is on EditText object not Item object.
    Please use Item.Specific to get the coresponding EditText and then set String.
    Regards,
    Jay.

  • How Do I create Windows Form file in VS and add the form to my VS project?

    C#, How Do I create Windows Form file in VS and add the form file to my VS project by using C# code?
    I like to create a Windows Form file into my VS Win Form project by using C#. I have the path and the file name.
    I need a Win Form with FileName.cs, FileName.Designer.cs, FileName.resx, and FileName (as you see it VS by adding a Win Form manually by using VS)
    Rune Brattas

    You cannot create a Form from code at run time. 
    For one thing, the user running your application will, almost certainly, not have  a copy of Visual Studio to hand with which to build anything.  (Not that you actually need 'Studio at all; Notepad and csc.exe are all you actually
    need), but that's another story).
    You can do this with an awful lot of pain, using the innards of the compiler from iside your own program, compiling the new Form's source code on the fly and then executing the resulting assembly within your application.  IMHO, that's a simply terrifying
    prospect especially as the code you will be compiling will be on someone else's machine and over which you will have absolutely no control.  If you're lucky, they'll spell something wrong and it won't compile.
    The "usual" way to do this sort of thing is to create additional, "plug-in" forms as library assemblies and have your program load and execute these at run-time. 
    Regards, Phill W.

  • How to open A Windows Form from Crystal Reports

    Hello All
    We are using crystal Repors 10 with Visual studio .Net 2005. Our requirement is to open the Windows Form when a user click on the respective Hyperlink. Simillarly popping up the MessageBox when clicking hyperlink.
    How this is possible, I will be really thankful to anyone who solves my problem

    Depending if this is a web or win app, you have different solutions.
    Web or win, use hyperlinks and redirect to an aspx page (I think hyperlinks are supported in CR 10.2).
    Win, use events as described in the sample app csharp_win_viewer_events.zip / vbnet_win_viewer_events.zip. I have never used the events to pop up a new form, but you should be able to do this.
    BTW.; make sure you have sp 1:
    https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • How to override the dialog "Do you want to save" while closing the form?

    HI
    I have two blocks on the form.Master block is based on a view wheres the detail block is populated by a procedure.
    Even if the user doesnot change any record and trying to close the form it is still showing the default "Do you want to save" with three options save,discard,cancel as choices.How can we prevent the form displaying that if the user is closing the form with out any uncommited changes.
    Thanks in advance.

    Read this thread about the affects of post-query and when-validate triggers:
        Message Do you want to change the changes you have made? caused by a lov

  • How to create a form and show it as a modal window in VB6?

    oform.modal  -> modal is read-only property
    help,please.

    Hi Santiago!
    HTH: How to create a form and show it as a modal window?

  • How do I delete recently closed windows from the history tab

    when closing the browser, even after private viewing, the site shows in the recently closed windows section of the history button on the toolbar. how can I delete this section. I have options set in the tool section but still doesn't work. helppppppppppppppppppp!

    Make sure to close all tabs in a window before closing that window.
    Set the pref browser.tabs.closeWindowWithLastTab to false on the about:config page to prevent closing the last tab from closing the browser and make a close button appear if only one tab is open.
    *http://kb.mozillazine.org/about:config

Maybe you are looking for

  • URGENT: Error while running page

    Hi, I am getting below error while running my page, but page is working fine, but it's taking time because of the error, can any one help me how to resolve this. <May 20, 2010 1:10:07 PM EDT> <Notice> <Stdout> <BEA-000000> <<UIXRegion><getRegionModel

  • Router Unknown

    I am trying to figure out why my video chat is not working on ichat. I am on a college campus and used it all last year no problem. I looked at the connection doctor and says router type: unknown. How do I fix this? -Melodie

  • How many iPhones stolen per day? Prevent shutdown.

    Dear friends. Since I had my iPhone stolen I'm searching for a way (without jailbreaking it) to prevent that my new iPhone gets lost. "Find my iPhone" is only useful when the thief is dum.b as hel.l and when nobody has found it (yet). Does Apple see

  • Question about Charging iPhone 5

    Hi I bought an iPhone 5 in New York and the charger does not fit the country where I live (Europe) and my question is it possible to use the charger of the iPhone 4? Tensions of the charges are the same? Or should buy an adapter and use the iPhone 5

  • Implementing methods in a class

    I have a class called Employee that uses getters and seters and methods from another project. I brought the code from the methods into the Employee class to run them in my class. It is supose to calculate an employee's monthly income plus commission