Results 1 to 3 of 3

Thread: SetFocus in Modal form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    81
    I've got a form which exists to get a small amount of input from a user - very much like the "InputBox" function. It's called like this
    Code:
    Dim sAnswer As String
    sAnswer = dlgInput.AskUser(Caption [,Default])
    The AskUser() function does a bit of setting up, fills the input text box with the default if it's supplied and that all works. It then displays the form Modally so that the user has to respond before it carries on. However, when I've filled the default in I want that to be the control that initially has focus - how do I do that??? I've tried
    Code:
    txtInput.SetFocus
    but I get an error, presumably because the form isn't yet shown at this point.
    Any ideas how I get the textbox to have focus, or can't I because of the nature of a modal form?

    TIA,
    Toot
    Some cause happiness wherever they go; others, whenever they go.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    I presume you are tryin load event
    move it to the form activate event
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    81

    Cool Nice one

    Thanks very much HeSaidJoe - worked a treat .

    Toot
    Some cause happiness wherever they go; others, whenever they go.

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