Disabled buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is there a way to keep a button from turning gray when its disabled?

Thanks

BrianDH
 
Hi Brian,

Add a button to a form & also add a checkbox

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked Then
Button1.Enabled = False
Button1.BackColor = Color.Red
Else
Button1.Enabled = True
Button1.BackColor = Color.LightGray
End If
End Sub

Try something like the above

Crouchie1998
BA (HONS) MCP MCSE
 
BrianDH said:
Is there a way to keep a button from turning gray when its disabled?

Override your button's 'OnPaint' method and place custom drawing code there.
 

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

Back
Top