Results 1 to 5 of 5

Thread: CheckBox focus rectangle

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    11

    Question CheckBox focus rectangle

    Does anyone know how to disable the focus rectangle that appears around the text of a checkbox when TABing into it?

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Does not appear to be a way - BUT, you can cheat! You can just set the text of the checkbox to nothing and then put a separate Lable control right next to it.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    11
    Yeh... and most probably i'll do that, since this checkbox is itself inside my usercontrol...

    BUT - i know there is a read-only UICuesEventArgs property called ShowFocus that is accsisable when the ChangedUICues event of the combobox is fired. This event is fired only at the first time i use the TAB in the form (even not if prior to that i have clicked on the combobox!). so as long as it was not fired, the rectangle doesn't show. after it was fired, the rectangle shows. So i'm sure there is some function/method call to change this property. (it was so easy in VB6!)

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    11
    Originally posted by Slow_Learner
    Does not appear to be a way - BUT, you can cheat! You can just set the text of the checkbox to nothing and then put a separate Lable control right next to it.
    I got a great suggestion from a mr jacob grass, to create my own checkbox:

    Public Sub MyCheckBox
    Inherits CheckBox

    Public Sub New()
    MyBase.New()
    ShowFocusCues = False
    End Sub
    End Class

    ShowFocusCues is a Protected Property of Control and only accessible in the class itself or derived classes.

    Uri

  5. #5
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Neat, thanks!

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