Copy from one, it's plagiarism; copy from two, it's research.
- Wilson Mizner
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Combo Box Colors
by: bs0d
Description:
Program is aimed at beginners to VB. You will see in this code sampe how to change the fillColor of a shape with a combo box. - (1 label, 1 combo box, 1 shape, 2 buttons).
See Full Size
Code:
Private Sub cboColors_Click() If cboColors.ListIndex = 0 Then shpSquare.FillColor = vbBlack End If If cboColors.ListIndex = 1 Then shpSquare.FillColor = vbBlue End If If cboColors.ListIndex = 2 Then shpSquare.FillColor = vbGreen End If If cboColors.ListIndex = 3 Then shpSquare.FillColor = vbRed End If If cboColors.ListIndex = 4 Then shpSquare.FillColor = vbWhite End If If cboColors.ListIndex = 5 Then shpSquare.FillColor = vbYellow End If End Sub Private Sub cmdExit_Click() 'Will terminate the program End End Sub Private Sub cmdPrint_Click() 'Will print the form PrintForm End Sub Private Sub Form_Load() 'Will center the form on the screen frmColors.Top = (Screen.Height - frmColors.Height) / 2 frmColors.Left = (Screen.Width - frmColors.Width) / 2 End Sub
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
17,198
Views
0
Total Comments
0
Rating of 5 (
1
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
RGB Color Fader
·
Adder
·
Math Problems
·
Cut and Paste
·
Flag Viewer
"AllSyntax.com" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy