Results 1 to 2 of 2

Thread: Tab Key (Focus Change) Causes Refresh

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    9

    Tab Key (Focus Change) Causes Refresh

    I have a lovely gradient on a label on my form, as decoration. However every time the tab key is pressed, the label's graphics clear. This only happens when Tab is pressed, not when focus is changed manually or on any other keypress.

    I tried putting the draw code into the Paint event on the label, doesn't work. Ditto for the paint event on the main form. Somehow it is refreshing without calling Paint()?

    I can't remove the tabstops because the user needs to be able to tab. I can't catch a Tab keypress without a horrendous amount of work, apparently.

    Is there a form event that will tell me when the focus changes within the form? Or am I going to have to add an Enter event to every control I want to tab to?

    I am totally at a loss here - it's probably something simple, but I can't work it out.

    Thanks,
    Andrew

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Tab Key (Focus Change) Causes Refresh

    Did you create the label by inheriting the base label control ?? You can also use (register in) the Invalidated event handler that's implemented in the Form and base controls . It's weird btw ...

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