Click here to Skip to main content
Rate this: bad
good
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
Comments
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.
—SA

1 solution

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

Solution 1

try to use form name with label for ex Form1.Label1.Text=""
  Permalink  
Comments
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
{
get
{
return this.labelX1.Text;
}
set
{
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 Marcin Kozub 275
1 OriginalGriff 249
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2014
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