Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WinForm
Hi Friends,
Form 1 label value is a. when i close form 2 i want reset the form 1 label value=b.
i do the closing event to set the value that value assigned but not reset pls help me... how to reset the form 1 label value ..
Thank's in advance...
Posted 20-Mar-13 21:42pm
Sergey Alexandrovich Kryukov at 21-Mar-13 2:54am
First, you did not define what is "reset" for a label. Then, why? Usually, labels never change; changing then confuses the user.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

try to use form name with label for ex Form1.Label1.Text=""
Athi Varathan at 21-Mar-13 2:55am
hi gopi,
i have done like this .. but not working..
formAA label.text="new";
when i close formBB -> closing event i want to change formAA.label.text="new code"; this value assigned but not set to the formAA it agin th e same formaa.text="new".
but i want the chenge label.text="new code".. pls and thank'e 4 ur rply
Gopinath_Rajan at 21-Mar-13 3:07am
k try to use get set properties
like below
public string LabelText
return this.labelX1.Text;
this.labelX1.Text = value;

form2 frm2 = new form2();
frm2.LabelText = "Your Text";

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

  Print Answers RSS
0 Dnyaneshwar@Pune 719
1 CPallini 245
2 Sergey Alexandrovich Kryukov 240
3 CHill60 235
4 TheRealSteveJudge 208
0 Sergey Alexandrovich Kryukov 9,008
1 OriginalGriff 6,771
2 Peter Leow 4,262
3 Zoltán Zörgő 3,769
4 Richard MacCutchan 2,623

Advertise | Privacy | Mobile
Web01 | 2.8.150128.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100