I made a secondary form named Form2 for my application in which the user can specify a Picture, Color and Text.
Now, on this Form2, after the user presses OK button, I want to send the the particulars to Form 1 and open it up.
For eg: If the user sets the color=Red, Picture=Img.gif, Text=Hi on Form2,
then the TextBox on Form1 should display Hi in red color and a picture in the PicBox in Form1.
How is the data sent form one form to another?
You can do it exactly the same way you would assign values from any class to any other class.
e.g.:
Where Form1 obviously needs something like:
You get the point.
A better way of doing that, specifically with forms is having a constructor in form2 which receives the arguments from Form1, and calling it before closing Form1:
i.e. in Form2:
(don’t get me on the syntax..)