|
-
Nov 19th, 2008, 01:35 PM
#1
Thread Starter
Member
[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
-
Nov 19th, 2008, 01:45 PM
#2
Hyperactive Member
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
-
Nov 19th, 2008, 01:53 PM
#3
Re: Changing background color
Welcome to the Forums.
You need to use the RGB, hex color code or the vb constant colors.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 19th, 2008, 01:57 PM
#4
Thread Starter
Member
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!
-
Nov 19th, 2008, 02:08 PM
#5
Addicted Member
Re: Changing background color
you can use "vb' before the name of the color
example:
red=vbred
green=vbgreen
IT CTO & System Administrator.
-
Nov 19th, 2008, 02:30 PM
#6
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 20th, 2008, 12:09 AM
#7
Addicted Member
Re: Changing background color
 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?
IT CTO & System Administrator.
-
Nov 20th, 2008, 04:40 PM
#8
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 20th, 2008, 05:16 PM
#9
Re: [RESOLVED] Changing background color
Yosef
Looks like RobDog mistook you for hobobobobobobobob.
The force is weakening with this one
Spoo
-
Nov 20th, 2008, 07:12 PM
#10
Re: [RESOLVED] Changing background color
 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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|