Click here to Skip to main content
15,878,871 members
Home / Discussions / C#
   

C#

 
GeneralRe: fill structure data using c# Pin
Luc Pattyn24-May-09 6:35
sitebuilderLuc Pattyn24-May-09 6:35 
GeneralRe: fill structure data using c# Pin
jalsa G24-May-09 6:44
jalsa G24-May-09 6:44 
GeneralRe: fill structure data using c# Pin
Luc Pattyn24-May-09 7:01
sitebuilderLuc Pattyn24-May-09 7:01 
Questioninsert datagridview items with foreach in to database Pin
h_floppy24-May-09 5:21
h_floppy24-May-09 5:21 
AnswerRe: insert datagridview items with foreach in to database Pin
dan!sh 24-May-09 5:24
professional dan!sh 24-May-09 5:24 
GeneralRe: insert datagridview items with foreach in to database Pin
fclose_fp24-May-11 8:01
fclose_fp24-May-11 8:01 
QuestionFocus in ToolStripControlHost after validating cancelled Pin
netogg24-May-09 4:24
netogg24-May-09 4:24 
AnswerRe: Focus in ToolStripControlHost after validating cancelled Pin
netogg29-May-09 23:53
netogg29-May-09 23:53 
Hi,

I've solved my problem, be it in a manner which could as well be posted under coding horrors:

In the validating event of the maskedTextBox I call on a timer (which was added to the userControl), and let its Tick event set the focus.

private void maskedTextBox1_Validating(object sender, CancelEventArgs e)
{
if (this.maskedTextBox1.Text == "0")
{
timer1.Start();
e.Cancel = true;
}
}

private void timer1_Tick(object sender, EventArgs e)
{
this.maskedTextBox1.Text = "1";
this.maskedTextBox1.Focus();
this.maskedTextBox1.SelectAll();
timer1.Stop();
}

Cheers. Wink | ;)
GeneralRe: Focus in ToolStripControlHost after validating cancelled Pin
acolight17-Mar-11 10:27
acolight17-Mar-11 10:27 
Question[Message Deleted] Pin
hkjghkj124-May-09 4:03
hkjghkj124-May-09 4:03 
AnswerRe: DataGridView and mdb Pin
Manas Bhardwaj24-May-09 4:20
professionalManas Bhardwaj24-May-09 4:20 
QuestionKeyPress Event Pin
Saiyed Alam24-May-09 0:58
Saiyed Alam24-May-09 0:58 
AnswerRe: KeyPress Event Pin
DaveyM6924-May-09 1:22
professionalDaveyM6924-May-09 1:22 
GeneralRe: KeyPress Event Pin
Saiyed Alam24-May-09 16:37
Saiyed Alam24-May-09 16:37 
Questionsearch in site Pin
michaelgr124-May-09 0:42
michaelgr124-May-09 0:42 
AnswerRe: search in site Pin
Manas Bhardwaj24-May-09 0:57
professionalManas Bhardwaj24-May-09 0:57 
GeneralRe: search in site Pin
michaelgr124-May-09 0:58
michaelgr124-May-09 0:58 
GeneralRe: search in site Pin
Manas Bhardwaj24-May-09 1:18
professionalManas Bhardwaj24-May-09 1:18 
GeneralRe: search in site Pin
michaelgr124-May-09 1:31
michaelgr124-May-09 1:31 
QuestionRefresh Datagrid Pin
KIDYA23-May-09 23:20
KIDYA23-May-09 23:20 
QuestionCalling Method of an Active Form from the MDI Parent Pin
uygarer23-May-09 23:13
uygarer23-May-09 23:13 
AnswerRe: Calling Method of an Active Form from the MDI Parent Pin
Moreno Airoldi24-May-09 0:12
Moreno Airoldi24-May-09 0:12 
AnswerRe: Calling Method of an Active Form from the MDI Parent Pin
DaveyM6924-May-09 0:25
professionalDaveyM6924-May-09 0:25 
QuestionFunction Caller Pin
Saiyed Alam23-May-09 22:56
Saiyed Alam23-May-09 22:56 
AnswerRe: Function Caller Pin
DaveyM6923-May-09 23:02
professionalDaveyM6923-May-09 23:02 

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.