Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir, How can send and retrieve value from one form to another form in window application. with syntex example. please help me...
Posted

One form (the receive of the value) needs a public property. The other form (the sender) needs a reference to the first form. Then, in the sender:

MyRefToReceive.MyProperty = MyValue;

If you want anything more specific than that, then you need to ask a more specific question.
 
Share this answer
 
Comments
anilthegreat 26-Jul-11 8:59am    
sir i want full syntex for send the value and receive value one form to another form.
Wjousts 26-Jul-11 9:18am    
I'm not writing code for you. I've told you how to do it. If you don't understand what I said then you need to start with some basic tutorials on C# and Windows Forms (there are lots of them out there). Once you have mastered the basic concepts, this should be easy.
Hi,

class A for form1,Class B form2

create property in class B
public string Input
{
get{retrun input;}
set{value=input;}
}

then assign value from class A using the object of class B.

B obj=new B();
obj.Input="your string";

in calss B you can acess this propert value

string x=Input;


this is not verified plas try it.
regards,
shefeek
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900