Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
GeneralUpdating values in a PropertyGrid Pin
WujekSamoZlo6-May-05 5:23
WujekSamoZlo6-May-05 5:23 
GeneralRe: Updating values in a PropertyGrid Pin
Mathew Hall6-May-05 15:28
Mathew Hall6-May-05 15:28 
Generalnewbie handling user controls click event in form Pin
Chenele6-May-05 5:11
Chenele6-May-05 5:11 
GeneralRe: newbie handling user controls click event in form Pin
Doctor Nick6-May-05 5:53
Doctor Nick6-May-05 5:53 
GeneralRe: newbie handling user controls click event in form Pin
Chenele6-May-05 6:44
Chenele6-May-05 6:44 
GeneralRe: newbie handling user controls click event in form Pin
MoustafaS6-May-05 9:03
MoustafaS6-May-05 9:03 
GeneralRe: newbie handling user controls click event in form Pin
Chenele6-May-05 9:16
Chenele6-May-05 9:16 
GeneralRe: newbie handling user controls click event in form Pin
S. Senthil Kumar6-May-05 8:02
S. Senthil Kumar6-May-05 8:02 
The button exposes a Click event that you can subscribe to. From within the event handler for click, you can set the label's text to whatever you want. The code will look like
public class MainForm : Form
{
   private Button button = new Button("Hai");
   private Label label = new Label();

   private void InitializeComponent()
   {
       button.Click += new ClickHandler(MainForm_buttonClick);
   }

   private void MainForm_ButtonClick(object sender, EventArgs e)
   {
       label.Text = "Bye";
   }
}


Note that you don't need to write all the event wireup code, VS.NET does it for you. You only need to write code to set the label's text.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralLZX or MSZIP Compressing Algorithms Imprementations Pin
Stanimir_Stoyanov6-May-05 4:26
Stanimir_Stoyanov6-May-05 4:26 
GeneralHaving problems writing text to a ListView Pin
Anonymous6-May-05 4:23
Anonymous6-May-05 4:23 
GeneralRe: Having problems writing text to a ListView Pin
ChesterPoindexter6-May-05 5:28
professionalChesterPoindexter6-May-05 5:28 
GeneralSerial Port communication Pin
Subrahmanyam K6-May-05 4:16
Subrahmanyam K6-May-05 4:16 
GeneralRe: Serial Port communication Pin
Gary Thom6-May-05 4:30
Gary Thom6-May-05 4:30 
GeneralAuto Login Pin
parsleylion6-May-05 3:59
parsleylion6-May-05 3:59 
GeneralRe: Auto Login Pin
jklucker6-May-05 5:40
jklucker6-May-05 5:40 
GeneralTexture mapping and color replacing with GDI Pin
DaViL836-May-05 3:39
DaViL836-May-05 3:39 
GeneralRe: Texture mapping and color replacing with GDI Pin
DaViL836-May-05 11:10
DaViL836-May-05 11:10 
General3d graph in C# Pin
Member 17766006-May-05 3:32
Member 17766006-May-05 3:32 
Generalnumber to alpha Pin
boruu6-May-05 3:06
boruu6-May-05 3:06 
GeneralRe: number to alpha Pin
keith maddox6-May-05 6:15
keith maddox6-May-05 6:15 
GeneralRe: number to alpha Pin
DavidNohejl6-May-05 6:17
DavidNohejl6-May-05 6:17 
Questionhow to set CustomDocumentproperyies for Word in C# Pin
Member 18788066-May-05 1:04
Member 18788066-May-05 1:04 
AnswerRe: how to set CustomDocumentproperyies for Word in C# Pin
Jon Merrifield6-May-05 1:42
Jon Merrifield6-May-05 1:42 
GeneralRe: how to set CustomDocumentproperyies for Word in C# Pin
Member 18788066-May-05 1:56
Member 18788066-May-05 1:56 
GeneralRe: how to set CustomDocumentproperyies for Word in C# Pin
Jon Merrifield6-May-05 2:06
Jon Merrifield6-May-05 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.