By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,157 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,157 IT Pros & Developers. It's quick & easy.

How to change background color in a grid?

P: 3
I want to change background color in a control in a form grid depending on the value in another control in the same grid. Can anyone giv me a hint about how to do this?
Mar 11 '11 #1
Share this Question
Share on Google+
1 Reply

P: 298
Combo0 is your color deciding comboBox
Text2 is your color changing textbox

you can retrieve the preferred color numbers from the property view after making a color selection

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo0_Change()
  2.     Select Case Combo0
  3.         Case 1
  4.             Text2.BackColor = 16777215 
  5.         Case Else
  6.             Text2.BackColor = 16744448
  7.     End Select
  8. End Sub
Mar 11 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.