[RESOLVED] Changing background color
hi all, this is my first post, im quite a noob let it be said!
i have a frame, in the frame i have a dropdown box with 3 options...
Open, Pending and Closed, and as you can see im trying to make the fram background color change for whichever option on the dropdown is selected.
Its giving me a huge headache at this stage and im sure one of you wise ones can point me in the right direction, thanks!!
Private Sub ComStatus_Change()
If ComStatus.Text = "Open" Then
FrmStatus.BackColor = blue
ElseIf ComStatus.Text = "Pending" Then
FrmStatus.BackColor = red
ElseIf ComStatus.Text = "Closed" Then
FrmStatus.BackColor = green
End If
End Sub
Re: Changing background color
It needs to be in the Click() event instead of Change(). And for the colors, add "vb" in front of them, vbBlue, vbRed etc
Re: Changing background color
Welcome to the Forums.
You need to use the RGB, hex color code or the vb constant colors.
Re: Changing background color
wow nice fast replying there lads, that worked a treat, i did some vb in college like 10 years ago, the vbRed brought back some memories hahaha
thanks alot!
Re: Changing background color
you can use "vb' before the name of the color
example:
red=vbred
green=vbgreen
Re: Changing background color
As a new member we would like to let you know that when your question has been answered you should go to the Thread Tools menu and select "Mark Thread as Resolved" so others will know your problem has been solved. ;)
Re: Changing background color
Quote:
Originally Posted by RobDog888
As a new member we would like to let you know that when your question has been answered you should go to the Thread Tools menu and select "Mark Thread as Resolved" so others will know your problem has been solved. ;)
sorry rob:
what do u mean?
Re: [RESOLVED] Changing background color
I see you resolved it already so what that now shows to others is that your question has been answered. Anyone looking to help wont have to waste time reading through the thread to find out its finished. ;)
Re: [RESOLVED] Changing background color
Yosef
Looks like RobDog mistook you for hobobobobobobobob.
The force is weakening with this one
Spoo
Re: [RESOLVED] Changing background color
Quote:
Originally Posted by Spoo
Yosef
Looks like RobDog mistook you for hobobobobobobobob.
The force is weakening with this one
Spoo
Nope, yosef_mreh asked me a question so I answered it. ;)