private void lblNewUser_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //UserName Label lblUN = new Label(); lblUN.Text = "UserName"; lblUN.Font = new Font(lblUN.Font, lblUN.Font.Style | FontStyle.Bold); lblUN.BackColor = Color.Transparent; lblUN.ForeColor = Color.White; lblUN.AutoSize=true; lblUN.Location = new Point(30,300); this.Controls.Add(lblUN); //Password Label lblPWD = new Label(); lblPWD.Text = "Password"; lblPWD.Font = new Font(lblPWD.Font,lblPWD.Font.Style|FontStyle.Bold); lblPWD.BackColor = Color.Transparent; lblPWD.ForeColor = Color.White; lblPWD.AutoSize = true; lblPWD.Location = new Point(30,350); this.Controls.Add(lblPWD); // Save Button Button btnSAVE = new Button(); btnSAVE.Text="Save"; btnSAVE.Font = new Font(btnSAVE.Font,btnSAVE.Font.Style|FontStyle.Bold); btnSAVE.Size = new Size(50,25); btnSAVE.BackColor = Color.Blue; btnSAVE.ForeColor = Color.White; btnSAVE.Location = new Point(100, 450); this.Controls.Add(btnSAVE); }
btnobj1.Click+=new System.EventHandler(ButtonClickHandler); private void ButtonClickHandler(object sender, EventArgs e) { Button button = sender as Button; if (button.Text == "Save") { //Do whatever } }
btnobj1.Click += new EventHandler(btnobj1_Click);
private void btnobj1_Click(Object sender, EventArgs e) { // here you can play with the txtobj3.Text }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)