PDA

Click to See Complete Forum and Search --> : [RESOLVED] [1.0/1.1] .net cf ShowDialog problem.


babyekc
Jan 11th, 2008, 01:47 AM
Hey guys,

I got a simple form1, which has a button1. When i click button1, it then open another form, which is form2, by using ShowDialog method. When i close the form2, i set the focus to form1. But the focus remains in button1. even if i have another button2, which i click on it (no code), i supposed the focus is on button2, but it eventually goes back to button1. how is this suppose to be? the focus is remain to a particular button after ShowDialog is fired.

need help urgently. thanks.

RobDog888
Jan 11th, 2008, 03:23 AM
Check your tab order. What is the TabIndex for each button?

babyekc
Jan 11th, 2008, 04:10 AM
im soree because this is an mobile app. can u move this thread to mobile forum?

RobDog888
Jan 11th, 2008, 04:12 AM
Oh Ok.

Thread Moved

babyekc
Jan 11th, 2008, 04:28 AM
anyone has any idea?

Shaggy Hiker
Jan 11th, 2008, 11:24 AM
I don't see what the problem is. If you click on a button, and in the button click event another form is shown with ShowDialog, then when that second form goes away, it makes sense for the focus to return to the button. Where else would it be?

babyekc
Jan 11th, 2008, 11:33 AM
Shaggy Hiker,

yea, it makes 100 senses after button click event and the form goes away, the focus return to the button itself. but my problem is, i wan to set the focus to another control, but it just remain in the button itself. even i click another button/combobox/textbox, the focus is still remain in the button itself.

Shaggy Hiker
Jan 11th, 2008, 01:44 PM
Normally, you'd use Button2.Focus() to set the focus to the second button, but you say that the focus will switch back on it's own. That seems kind of odd. Is there anything that specifically sets the focus to the first button?

babyekc
Jan 13th, 2008, 07:19 AM
yes, to set the focus after using showdialog method make me sick.