How to get the Start Form object in the Winform program 20

Updated on technology 2024-05-28
13 answers
  1. Anonymous users2024-02-11

    1) In , modify the program class.

    using system;

    using ;

    using ;

    using ;

    Application.

    The main entry point.

    stathread]

    static void main();

    Use form2 in the project as the launch form.

    2) Get the startup form.

    In your program, use the following ** to get the startup form.

  2. Anonymous users2024-02-10

    As an example, hope it helps. ** Private void buttonconfirm click(object sender, eventargs e) result.

  3. Anonymous users2024-02-09

    Form is also a class, and the objects of this class are no different from others, as long as they are public, they can all be accessed by each other, not necessarily static

    In a WinForm program, the Form object is usually a horizontal relationship, and the ** written is usually below this level, so you will feel that you don't know how to reference the desired window object (as long as the object is referenced, the public members in the object can be accessed), in fact, it is very simple, two methods, 1A record of all window objects is kept at the upper level of the form (e.g. your first window) so that all windows can access each other.

    2.If the window has a strong affiliation, you can use it as a private member of the window that generated (or opened) it.

  4. Anonymous users2024-02-08

    Add that from to the current project on the basis of the public static variable, use the namespace or package that you want to reference form in your current class, and then create the object, and click the fromVariable name.

  5. Anonymous users2024-02-07

    new form() and bring the variable over form1

    string str1 = ;

    public form1() construct the function.

    form2string str2 = ;

    public form2(string str1).

  6. Anonymous users2024-02-06

    Why doesn't it work?

    Also, you can make another class, set the member to public, and transfer through this class.

  7. Anonymous users2024-02-05

    new myform().showdialog();myform is the form you're going to open.

    If your form is in another project, you need to right-click on the current project to add the app.

  8. Anonymous users2024-02-04

    Declaring an object, and then the object's show() will do. It's simple.

  9. Anonymous users2024-02-03

    InitializeComponent() is used to initialize the interface.

    c is also main. WinForm programs are event-driven.

    The console program is similar to C++. You can see it by selecting the console when you create it.

    That's what I know. Still learning.

  10. Anonymous users2024-02-02

    Overload the form2 constructor, pass the form1 object to form2, use show() when form2 displays, and use the passed object in form2 to get the current form1 running state.

  11. Anonymous users2024-02-01

    It's hard to put into words, but here's the way: you go and learn about multithreading and non-modal windows.

  12. Anonymous users2024-01-31

    private void createform(string strname)

    You can try to do it with reflexes.

  13. Anonymous users2024-01-30

    What are you going to read? Please make the problem clear, or no one will take care of you.

Related questions
7 answers2024-05-28

int sum=0;

for(int i = 0 ;i< -1;i++) assumes that the ID of the datalist is datalist1 >>>More

14 answers2024-05-28

function getsqlserverlist(strings:tstrings):boolean;

The function is implemented as follows: >>>More

8 answers2024-05-28

Generally refers to floppy disks for DOS.

Now there are also discs that can be used without an operating system. >>>More

11 answers2024-05-28

The simplest and most complex method.

Iterate through each element of one vector and find the same in the other. >>>More