CheckBox (help!)

  • Thread starter Thread starter Yama
  • Start date Start date
Y

Yama

Hello all,


In Design-Time I created a form with many checkboxes which contained no "text". It looked something like this:
 
Handle the Paint event and draw a focus rectangle yourself
Like this:

Private Sub checkBox_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles checkBox.Paint
Dim ctrl As Control = CType(sender, Control)
If ctrl.Focus Then
' Paint a focus rectangle
Dim rc As Rectangle = ctrl.ClientRectangle
rc.Inflate(-1, -1)
rc.X = 0
rc.Y = 0
ControlPaint.DrawFocusRectangle(e.Graphics, rc)
End If
End Sub


/claes

PS. Please don't post in HTML

*********************************************
Hello all,


In Design-Time I created a form with many checkboxes which contained no
"text". It looked something like this:

----------------------------------------------------------------------------
--
mycheckboxes: 0 0 0 0 0
mycheckboxes2: 0 0 0 0 0
----------------------------------------------------------------------------
--

where "0" is a checkbox. The problem I am having in Run-Time is that I
cannot see the focus on these checkboxes unless there is text on it. Is
there a way I can Override the focus from "text" to the control itself?

Yama
 
Back
Top