Click here to Skip to main content
11,637,415 members (64,588 online)
Click here to Skip to main content

Multifunctional Checkbox for Visual Studio .NET

, 13 May 2005 50.5K 91 14
Rate this:
Please Sign up or sign in to vote.
CheckBox with different checked and border styles.

Sample Image - CheckBox.gif

Introduction

This article introduces check boxes with different checked and border styles. The following lists shows the different properties and events associated with them.

Properties

  • Caption (String) - Addition of a text.
  • TextColor (Color) - Color of the text.
  • TextFont (Font)- Font of the text.
  • CStyle (Enumeration) - Kind of selected graphics.
  • FStyle (Enumeration) - Visible style.
  • StyleKind (Enumeration) - Kind of visible style.
  • SmoothingMode (SmoothingMode) - Quality of the graphics.
  • CheckedState (Boolean) - CheckBox is selected or deselected.
  • CheckedColor (Color) - Selected color.

Events

  • BeforeChanging - Event which will execute before checking.
  • CheckedChanged - Event which will execute after checking.

Examples

'Show "MessageBox" after click with current "Checked_State"
Private Sub CheckBox1_CheckedChanged(ByVal Checked_State As Boolean) _
      Handles CheckBox1.CheckedChanged
    MsgBox(Checked_State)
End Sub
'Change "ForeColor" of the text after click
Private Sub CheckBox1_CheckedChanged(ByVal Checked_State As Boolean) _
     Handles CheckBox1.CheckedChanged
    CheckBox1.ForeColor = Color.Red
End Sub
'Change kind of style after click
Private Sub CheckBox1_CheckedChanged(ByVal Checked_State As Boolean) _
    Handles CheckBox1.CheckedChanged
    'Change CheckBox Style
    CheckBox1.FStyle = CheckBox.CheckBox.Flat_Style.Blue 
    'Paint 'X' as checked_State
    CheckBox1.CStyle = CheckBox.CheckBox.Check_style.Draw_X 
    'Draw circle as CheckBox field
    CheckBox1.StyleKind = CheckBox.CheckBox.Style_Kind.Circle 
End Sub
'Change "SmoothingMode"
Private Sub CheckBox1_CheckedChanged(ByVal Checked_State As Boolean) _
         Handles CheckBox1.CheckedChanged
    CheckBox1.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
End Sub

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Loresoft
Web Developer
Germany Germany
No Biography provided

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150728.1 | Last Updated 13 May 2005
Article Copyright 2005 by Loresoft
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid