Results 1 to 3 of 3

Thread: SetFocus

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    Northampton, MA
    Posts
    10

    Post

    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
    [email protected]

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

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    East Anglia, England
    Posts
    73

    Post

    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

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width