How to pass value from one form to another form in .Net?
I want to access value of one form on the another form, But i can't do this. So please help and tell me how i pass.
I wrote this article in response to an almost overwhelming number of requests on forums on how to pass a variable from a one Windows Form to another. In fact, saying that it is going between one form and another is somewhat of a misnomer because this will work for any type of object not just Forms. This seems to be one area where beginners in C# and VB.NET often get stuck. So, rather than having to repeat myself often in forums I wrote this article so that I could point people at it so that they will have the benefit of a full explanation as well as the answer to their problem.
The code examples that come with this article are available for VB.NET and C# so that neither group feels left out. If you develop software in any of the other languages available for .NET then you can probably follow on too. The techniques are the same for all .NET languages the only difference should be in the language syntax.
pass value one form to another form
its ok Stive Smith. But i wana to solution of my question because i have need this in my project.
if your both the forms are running, then you can use
Else you can declare a Public String variable in Form2, on any event,
dim Obj as new Form2
and on Form2 Load,
Thanks Priyanka for your nice information. I can try this.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread