Consulting

Results 1 to 8 of 8

Thread: Solved: Disable focus Textbox.

  1. #1

    Question Solved: Disable focus Textbox.

    My question is simple. And here it is : Does anyone knows how do i disable the focus of a textbox. Like setfocus = false in a normal vb6. Unfortunately it doesn't work in PowerPoint.

    Thanks.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by hobgoblin
    My question is simple. And here it is : Does anyone knows how do i disable the focus of a textbox. Like setfocus = false in a normal vb6. Unfortunately it doesn't work in PowerPoint.

    Thanks.
    Hi and Welcome to VBAX!

    Don't think I've ever found use to do a thing like that so I'm curious.

    Could explain what you are trying to do in more detail? Why is setting focus false so Important...what don't you want to happen?
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3
    Ok. What I am doing is using the KeyUp (When i press enter) event of a textbox to get data. But if i have an error i show up a message box. And when user presses enter ( OK button of message box ) and the focus is on the textbox, VB catches it as an ENTER key press of the textbox as well. So it tries to get data again, and again, and again.... I tried to put enabled false, locked true etc on the textbox, but the texbox still catches the ENTER key press. And since i don't have any other textbox's I cant just shift focus out of it. That's about it. Any help would be very appreciated.

  4. #4
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Have you considered using the Exit event of the textbox for the validation?
    K :-)

  5. #5
    Well that's the thing. I dont want to exit the texbox. What i want to do is to just temporarily disable it, and when i'm done getting data put the focus back on it.

  6. #6
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    I see... well that's most inconvenient
    I had a quick test and it seems to behave properly on the KeyDown event
    K :-)

  7. #7
    OK KeyDown it is then

    Thanks alot for your help.

  8. #8
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by hobgoblin
    OK KeyDown it is then

    Thanks alot for your help.
    Glad to see K helped you out!

    Don't forget to mark to thread solved?
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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