Click here to Skip to main content
15,886,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: TrimEnd? Pin
Guffa5-Nov-08 3:22
Guffa5-Nov-08 3:22 
AnswerRe: TrimEnd? Pin
Pedram Behroozi4-Nov-08 23:43
Pedram Behroozi4-Nov-08 23:43 
AnswerRe: TrimEnd? [modified] Pin
Guffa5-Nov-08 3:21
Guffa5-Nov-08 3:21 
Questiondatagridview checkbox [modified] Pin
arkiboys4-Nov-08 20:57
arkiboys4-Nov-08 20:57 
AnswerRe: datagridview checkbox Pin
cocoonwls4-Nov-08 23:25
cocoonwls4-Nov-08 23:25 
AnswerRe: datagridview checkbox Pin
dan!sh 5-Nov-08 0:24
professional dan!sh 5-Nov-08 0:24 
QuestionCreating a number of buttons with different onclick commands Pin
Matjaz-xyz4-Nov-08 19:39
Matjaz-xyz4-Nov-08 19:39 
AnswerRe: Creating a number of buttons with different onclick commands Pin
cocoonwls4-Nov-08 20:30
cocoonwls4-Nov-08 20:30 
hi,

Use for loop to create the button and add eventhandler for each button you create.Below is a sample:

{
   InitializeComponent();
   this.Load += new EventHandler(Form1_Load);
}

private void Form1_Load(object sender, EventArgs e)
{
    Button[] b = new Button[3];
    for (int i = 0; i < 3; i++)
    {
       b[i] = new Button();
       b[i].Name = i.ToString();
       b[i].Click +=new EventHandler(Form1_Click);
       b[i].Location = new Point(i * 10, i * 10);
                
    }
    this.Controls.AddRange(b);
}

private void Form1_Click(object sender, EventArgs e)
{
   Button b = (Button)sender;
   Console.WriteLine(b.Name);
}


Hope this helpSmile | :)
AnswerRe: Creating a number of buttons with different onclick commands Pin
Pedram Behroozi4-Nov-08 22:32
Pedram Behroozi4-Nov-08 22:32 
GeneralRe: Creating a number of buttons with different onclick commands Pin
cocoonwls4-Nov-08 23:15
cocoonwls4-Nov-08 23:15 
GeneralRe: Creating a number of buttons with different onclick commands Pin
Pedram Behroozi5-Nov-08 0:21
Pedram Behroozi5-Nov-08 0:21 
GeneralRe: Creating a number of buttons with different onclick commands Pin
Matjaz-xyz5-Nov-08 5:02
Matjaz-xyz5-Nov-08 5:02 
QuestionHow to detect arrows key in key press event handler? Pin
cocoonwls4-Nov-08 19:12
cocoonwls4-Nov-08 19:12 
AnswerRe: How to detect arrows key in key press event handler? Pin
Pedram Behroozi4-Nov-08 19:33
Pedram Behroozi4-Nov-08 19:33 
AnswerRe: How to detect arrows key in key press event handler? [modified] Pin
Matjaz-xyz4-Nov-08 19:34
Matjaz-xyz4-Nov-08 19:34 
AnswerRe: How to detect arrows key in key press event handler? [modified] Pin
cocoonwls4-Nov-08 20:10
cocoonwls4-Nov-08 20:10 
GeneralRe: How to detect arrows key in key press event handler? Pin
Pedram Behroozi4-Nov-08 22:35
Pedram Behroozi4-Nov-08 22:35 
GeneralRe: How to detect arrows key in key press event handler? Pin
cocoonwls4-Nov-08 23:12
cocoonwls4-Nov-08 23:12 
AnswerRe: How to detect arrows key in key press event handler? Pin
dan!sh 4-Nov-08 22:03
professional dan!sh 4-Nov-08 22:03 
GeneralRe: How to detect arrows key in key press event handler? Pin
cocoonwls4-Nov-08 23:15
cocoonwls4-Nov-08 23:15 
GeneralRe: How to detect arrows key in key press event handler? Pin
dan!sh 5-Nov-08 0:16
professional dan!sh 5-Nov-08 0:16 
GeneralRe: How to detect arrows key in key press event handler? Pin
cocoonwls6-Nov-08 15:15
cocoonwls6-Nov-08 15:15 
AnswerRe: How to detect arrows key in key press event handler? Pin
vaynenick18-Jun-14 22:19
vaynenick18-Jun-14 22:19 
QuestionPictureBox and ThumbNail code causing Application to NOT close. Pin
swjam4-Nov-08 19:02
swjam4-Nov-08 19:02 
AnswerRe: PictureBox and ThumbNail code causing Application to NOT close. Pin
Simon P Stevens4-Nov-08 22:34
Simon P Stevens4-Nov-08 22:34 

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.