To pass the string variable value from C# to another form to another form

Asked 2 years ago, Updated 2 years ago, 41 views

I want to know how to transfer the string variable value from C# to another form. Please let me know!!

c#

2022-09-22 20:44

1 Answers

It's not a best practice, but it's possible with a stain.

Form 1 and Form 2

To the form cs file that you want to hand over the variable

public static string name;

It's defined in this way. For example, suppose you define Form 2 like that

Next, when you give the data,

Form2.name = "data";

You can give it like this.


2022-09-22 20:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.