CheckBox (help!)

Y

Yama

Hello all,


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

Claes Bergefall

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top