Click here to Skip to main content
15,922,145 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello
i have Form1 with a labelControl in it.
C#
label1.text="hello";
i want to load Form1 by clicking and reset text property of label1 in Form1 loading event:
C#
label1.text="hello world";

is it possible?How?
thanks
Posted
Updated 2-Mar-12 17:39pm
v2

1 solution

Well, if you're resetting the text in the Form1 Load event, there's really nothing to click on now is there??

You might want to explain in a bit more detail what exactly is supposed to happen when. For instance, WHAT are you clicking on??
 
Share this answer
 
Comments
FM7 2-Mar-12 23:47pm    
i click the button to load the form
frmAttention newfrm1=new frmAttention();
newfrm1.showDialog();
now i want to write some text in the label in this form when newfrm1 is loaded.OK?
Dave Kreskowiak 3-Mar-12 0:06am    
Since you're showing the form with ShowDialog, it's a blocking call for that code, so you can't do anything there until the form is closed.

The only thing you can do is, depending on requirements, either show the form with Show instead of ShowDialog, or in the frmAttention code, changing the label text in the Load event of that form.

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