Pass value one form to another in c# [Resolved]

Posted by Sakthi.Singaravel under C# on 6/5/2012 | Points: 10 | Views : 23735 | Status : [Member] | Replies : 8
How to Pass value one form to another in c#?

Regards,
Singaravel M



Responses

Posted by: Ajay.Kalol on: 6/5/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved

Take Class file.
Put this Code inside it.

Public string MyVar

{ get; set; }


and then Access this variable by defining object of class.

if you want to set Value to it then

objcls.MyVar = "Ajay";


want to Get value then

string str = objcls.MyVar;


It is so Simple.

if you like then Mark it as Answer.

Ajay
ajaypatelfromsanthal.blogspot.in

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kavi.Sirius on: 6/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

In windows application:

you have to create Global variables to pass the value from one form to another

In web application:

you can pass values through

session variables,
querystring,
viewstate


Regards
Kavi.n

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 6/5/2012 [Member] Starter | Points: 25

Up
0
Down
In Winform Application

You should use global Variable for state Management.

Ajay
ajaypatelfromsanthal.blogspot.in

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 6/5/2012 [Member] Silver | Points: 25

Up
0
Down
how to declare global variables...?

Regards,
Singaravel M

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kavi.Sirius on: 6/5/2012 [Member] Starter | Points: 25

Up
0
Down
hi

Refer this link for
declare the global variables.

http://forums.codeguru.com/showthread.php?t=470911

Regards
Kavi.n

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 6/5/2012 [Member] Silver | Points: 25

Up
0
Down
@ajay
So nice...
Thank u very much...

Regards,
Singaravel M

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravianand on: 6/6/2012 [Member] Starter | Points: 25

Up
0
Down
refer this link
http://codeincsharp.blogspot.in/2008/04/how-to-pass-values-to-another-form.html

Regards,
Ravi

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 6/6/2012 [Member] Silver | Points: 25

Up
0
Down
@Ravi

Thank u for ur reply..

Already i got it..


Regards,
Singaravel M

Sakthi.Singaravel, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response