setting focus

  • Thread starter Thread starter BillyAnalog
  • Start date Start date
B

BillyAnalog

I am a newbie to c sharp and I have a problem !
I am trying to set focus on my textBox1 after I click on a button in my
form. now in Delphi I Do this with
Edit1.Text := setfocus;
but in c sharp??
 
thanks for the help but it simply would not work
I am wery new to c sharp so I probably messed up but here is part of the
code:

private void button11_Click(object sender, System.EventArgs e)

{

//PLUSS

if (denne == 0)


{

denne = 1;

sumere1 = Convert.ToInt32(textBox1.Text);

textBox1.Text =("");//Convert.ToString(sumere1);;

label1.Text = Convert.ToString(sumere1)+" + ";

textBox1.Focus();

}


}

any feedback apreciated.
 
I copied your code into a sample project, placed a button, textbox and label
on the form.

When I ran it it seemed to run correctly. Is there anything else happening
on the form that might be interfering?

Kirk Graves
 
Back
Top