Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code for background colors

Status
Not open for further replies.

RSH

Technical User
Jun 15, 2000
55
0
0
US
I find a background color property listed for code and assume that this property should equal some number. Looping it through 1 to 10000 all I come up with is red and black sequentiallly. What am I missing.
73 RSH [sig][/sig]
 
can you give us the code that you are trying to use. Also if the color codes are like vbcoloractive (or something similar) then those colors are not equal to a strict number, but whatever the user's "Active" color is on that system.

Also this might help

[tt]
Color Constants


Colors
Constant Value Description

vbBlack &H0 Black
vbRed &HFF Red
vbGreen &HFF00 Green
vbYellow &HFFFF Yellow
vbBlue &HFF0000 Blue
vbMagenta &HFF00FF Magenta
vbCyan &HFFFF00 Cyan
vbWhite &HFFFFFF White


System Colors
Constant Value Description

vbScrollBars &H80000000 Scroll bar color
vbDesktop &H80000001 Desktop color
vbActiveTitleBar &H80000002 Color of the title bar for the active window
vbInactiveTitleBar &H80000003 Color of the title bar for the inactive window
vbMenuBar &H80000004 Menu background color
vbWindowBackground &H80000005 Window background color
vbWindowFrame &H80000006 Window frame color
vbMenuText &H80000007 Color of text on menus
vbWindowText &H80000008 Color of text in windows
vbTitleBarText &H80000009 Color of text in caption, size box, and scroll arrow
vbActiveBorder &H8000000A Border color of active window
vbInactiveBorder &H8000000B Border color of inactive window
vbApplicationWorkspace &H8000000C Background color of multiple-document interface (MDI) applications
vbHighlight &H8000000D Background color of items selected in a control
vbHighlightText &H8000000E Text color of items selected in a control
vbButtonFace &H8000000F Color of shading on the face of command buttons
vbButtonShadow &H80000010 Color of shading on the edge of command buttons
vbGrayText &H80000011 Grayed (disabled) text
vbButtonText &H80000012 Text color on push buttons
vbInactiveCaptionText &H80000013 Color of text in an inactive caption
vb3DHighlight &H80000014 Highlight color for 3D display elements
vb3DDKShadow &H80000015 Darkest shadow color for 3D display elements
vb3DLight &H80000016 Second lightest of the 3D colors after vb3Dhighlight
vb3DFace &H8000000F Color of text face
vb3Dshadow &H80000010 Color of text shadow
vbInfoText &H80000017 Color of text in ToolTips
vbInfoBackground &H80000018 Background color of ToolTips
[/tt]

Oh also if you havent noticed, the nubmers are in Hexidecimal. [sig]<p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
[/sig]
 
Karl:
The code I was attempting to use as I recall.
Form1.backcolor= (Decimal Number). That decimal number thing might have been the problem. VB didnt fight me on the use of a number after the = and I was getting color,but not controllable color. Will print out your above data and try some things. Thanks
73 RSH [sig][/sig]
 
Guess I will put this back on top for another go.
Tried hex numbers for backcolor and VB crashed. Somthing is missing.
73 RSH [sig][/sig]
 
try form1.backcolor = vbBlue
[sig] <br>
<br>
<br>
********Byte me ********[/sig]
 
MOP:
Thanks Will Try.
The data above given by KB244 was right on the nose. The problem was your operator. They call it cockpit error.
Will try your info. It seems even simpler.
73 RSH [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top