PDA

Click to See Complete Forum and Search --> : SetFocus


Slimak
Nov 6th, 1999, 01:59 PM
I have that small problem with SetFocus after a MessageBox Prompt. It just doesn't work. My question is where should I put SetFocus code (what Event) to make it works after users clicks any button on a messagebox.
Thanks

------------------
Marek Karbarz
My WebPage (http://members.spree.com/sports/slimak)
Zarembisty@aol.com

[This message has been edited by Slimak (edited 11-07-1999).]

Desire
Nov 6th, 1999, 07:03 PM
I think this is what you're after,
Add a command button and a textbox to form1

Option Explicit

Private Sub Command1_Click()
Dim Result As VbMsgBoxResult

Result = MsgBox("Would you like to set the focus to the textbox?", vbQuestion + vbYesNo, "Set Focus")
If Result = vbYes Then
Text1.SetFocus
End If
End Sub

QWERTY
Nov 6th, 1999, 08:40 PM
Thanks

------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.

P.S. QWERTY=SLIMAK


[This message has been edited by QWERTY (edited 11-07-1999).]