Click here to Skip to main content
15,881,588 members
Articles / Programming Languages / Visual Basic
Article

Multifunctional Checkbox v2 for Visual Studio .NET

Rate me:
Please Sign up or sign in to vote.
2.31/5 (10 votes)
2 Jul 2005 53.6K   212   13   4
Checkboxes with different checked and border styles.

Sample Image - CheckBox.gif

Introduction

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

Properties

  • Caption (String) - Addition of a text.
  • CheckedColor (Color) - Selected color.
  • CheckedState (Boolean) - Checkbox is selected or deselected.
  • CStyle (Enum) - The kind of selected graphics.
  • EnableClickSound (Boolean) - Play sound on click.
  • FocusColor (Color) - Color of rectangle when it gets focus.
  • FStyle (Enum) - Visible style.
  • HoverAnimation (Boolean) - Fade animation when moving.
  • SmoothingMode (SmoothingMode) - Quality of the graphics.
  • StyleKind (Enum) - Kind of visible style.
  • TextFont (Font)- Font of the text.
  • TextColor (Color) - Color of the text.

Events

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

Examples

  • Show "MessageBox" after click when in "Checked_State":
    VB
    Private Sub CheckBox1_CheckedChanged(ByVal _
           Checked_State As Boolean) Handles CheckBox1.CheckedChanged
        MsgBox(Checked_State)
    End Sub
  • Change "ForeColor" of the text after click:
    VB
    Private Sub CheckBox1_CheckedChanged(ByVal Checked_State _
                  As Boolean) Handles CheckBox1.CheckedChanged
        CheckBox1.ForeColor = Color.Red
    End Sub
  • Change kind of style after click:
    VB
    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":
    VB
    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


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionMissing source coce Pin
fabricedupre@free.fr14-Feb-24 7:53
fabricedupre@free.fr14-Feb-24 7:53 
QuestionWhere's the source code? Pin
Member 175014621-May-08 5:27
Member 175014621-May-08 5:27 
GeneralNice But... Pin
Gary Noble2-Jul-06 0:51
Gary Noble2-Jul-06 0:51 
Generalcool but Pin
tom_dx2-Jul-05 16:14
tom_dx2-Jul-05 16:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.