Code Snippets

  

Visual Basic Source Code


Welcome to Dream.In.Code
Become a VB Expert!

Join 137,214 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,242 people online right now. Registration is fast and FREE... Join Now!





VB6 sticky button, VB6 toggle button

A simpler way of making a toggle (or sticky) button than my previous example...

Submitted By: jens
Actions:
Rating:
Views: 283

Language: Visual Basic

Last Modified: October 9, 2008
Instructions: Instructions in the code.

Snippet


  1. '==================================
  2. ' On a form, make a checkbox named
  3. ' Check1. Change its property style
  4. ' to "1 - Graphical" and put this
  5. ' code as it's click event.
  6. ' So much easier than the other
  7. ' one I submitted.
  8. '----------------------------------
  9. Private Sub Check1_Click()
  10.    If Check1.Value = vbChecked Then
  11.       Check1.ForeColor = vbRed
  12.       Check1.Caption = "Checked - ON"
  13.    Else
  14.       Check1.ForeColor = vbGreen
  15.       Check1.Caption = "Unchecked - OFF"
  16.    End If
  17. End Sub
  18.  

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month