C forms to transfer values, C in C how many ways to transfer values? Give me an example

Updated on Car 2024-04-01
4 answers
  1. Anonymous users2024-02-07

    Your form2 constructor should be overloaded once: it should pass the textbox as an argument and it becomes:

    private

    textbox

    txtbox

    null;public

    form2(textbox

    txtbox)

    txtbox

    txtbox;

    When form1 is double-clicked, it is called like this:

    form2frm2

    newform2(name);

    This way, you can set it up as you like in FRM2

    a piece of content;

  2. Anonymous users2024-02-06

    The first method is the static variable mechanism, C publishes a static variable is to expose an existing instance of the class, similar to VC, let's say we write this in a form:

    public static string str="";

    void loadforms(object sender,eventargs e)

    The other form reads:

    private void listbox1_selectitem(..listview.

    This means that after opening form2 and selecting listbox on form2, form1 will be displayed in real time if it is not closed. Of course, you can also assign str directly, and then show other forms and use it directly. This method is called static value transfer.

    The second is to encapsulate the property, I encapsulate its inherent value as an attribute and assign a value to the property, as I wrote in form form2:

    public string str

    set} then the form can be written like this:

    void loadforms(..

    The last method is inheritance, when a subclass inherits from its own class, it inherits its member variables, e.g. I inherited form1 in form2, and in form2 it is written:

    namespace namespace. Catalog folder.

    Here you can use form1 directly...

    In the web, there is one more upstairs person who said a part. In fact, there is also remoting, which can also be used to transfer values, when you set up a server, remoting can monitor your program in real time, and send values in real time to respond to the client.

  3. Anonymous users2024-02-05

    Get submits the value, that is, the url parameter is passed.

    The value of the post submission method is the value of the form submission;

    cookie transfer;

    session value;

  4. Anonymous users2024-02-04

    Upstairs is talking about winform, and it looks like what you want.

Related questions
8 answers2024-04-01

It's Helicobacter pylori infection, it's not serious, many people have it, but if you don't ** for a long time, it will be serious. Suggestions: The ** regimen of Helicobacter pylori positive includes two categories, which are basically commonly used drugs, one is a bismuth preparation-based regimen, and the other is a regimen represented by proton pump inhibitors. >>>More

16 answers2024-04-01

c Parameter defaults are not supported, and if you want to implement the same functionality, you can use the method of function overloading to simulate the implementation. Such as: >>>More

8 answers2024-04-01

2D array address - > row address - > column address (variable address) - > variable value, or excerpt a description for you. >>>More

13 answers2024-04-01

bool is a boolean variable, that is, a determinant of a logical variable, similar to float, double, etc., except that float defines floating-point and double defines double-precision floating-point. Boolean variables have only true and false values. Examples: >>>More

5 answers2024-04-01

int max(float fx,float fy)float fz;

fz=fx>fy?fx:fy; >>>More