Results 1 to 5 of 5

Thread: [02/03] Focus issue

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Exclamation [02/03] Focus issue

    I have 2 forms, frmMain and frmOptions. On frmOptions, there are 2 text boxes. When I load frmOptions, the first text box has focus. I don't want a cursor to be in either text box. If it is possible, I don't want any object on the form to have focus. I have code in the event that the first textbox has focus, and when the form loads and the textbox has automatically has focus and i don't want it to. How can i fix this?

    Thanks.

  2. #2
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: [02/03] Focus issue

    Give focus to the form itself so that it is still on the top:

    frmOptions.Activate
    VB 2005, Win Xp Pro sp2

  3. #3

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Re: [02/03] Focus issue

    Tried it and it still gave focus to the textbox.

  4. #4
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: [02/03] Focus issue

    mabye give the form focus on load?

  5. #5

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Re: [02/03] Focus issue

    No, that is pretty much what frmOptions.Activate does. If anyone is using IE7, it want it to be like the search bar at the top right (even on firefox it does this i believe) where the cursor is not shown. I would like to do the same thing where there is text in gray (where it says MSN Search or Google or whatever you chose as your default search provider) and there is no cursor in the textbox control. Once the user clicks the textbox, the text disappears and the user and type in what they want. Once the user clicks out of the box and there is no text in the box, the gray text comes back. I would like to do this and I have it working, it's just that the cursor is set to the textbox on form load and the gray text is deleted because it activates the textbox_gotfocus function.

    Anyone know what I am trying to describe?

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