Jobs
Author: Patrick Lockefeer (III) Date Submitted: 7/24/2005 Category: Microsoft Controls Compatibility: VB 6 This code has been accessed 2942 times.
Email Yourself this snippet:
'No Declarations Controls : Frame : Name Frame1 2 Optionbuttons : Name :Option1 Caption :Forecolor Name :Option2 Caption :BackColor 'Add Colorpicker control >> Components >> Colorpicker v1.0 ColorPicker Name :Colorpicker1 TextBox Name :Text1
Code
'Click on the Colorpicker to open ColorPalette 'Pick your Color 'Note that the Optionbutton will change to the other Option (vice versa) Private Sub ColorPicker1_Click() If Option1.Value = True Then Text1.ForeColor = ColorPicker1 'Change to BackColor option Option1.Value = False Option2.Value = True Else Text1.BackColor = ColorPicker1 'Change to ForeColor option Option1.Value = True Option2.Value = False End If End Sub Private Sub Option1_Click() Option1.Value = True End Sub Private Sub Option2_Click() Option2.Value = True End Sub