|
-
Sep 21st, 2000, 10:08 PM
#1
Thread Starter
Lively Member
Hi everybody.
How can I make BackColor of Label object has the same color of the Active Title Bar color (2 colors in case of Win98/2000).
-
Sep 22nd, 2000, 04:42 AM
#2
Frenzied Member
For setting it as a single color:
Go to the Properties box for the label
Find the BackColor property
Click the down arrow to open the color pallette
Click the System tab (instead of the Pallette tab)
Find the item Active Title Bar
Click it
Your label will be set to the system's active title bar color.
For the two colors:
You need to find the two colors to use in the registry, then use the DrawGradient API to draw the gradient. One catch: it won't work on labels, so youd need to use a PictureBox instead.
Hope that helps.
-
Dec 21st, 2000, 10:58 AM
#3
Hyperactive Member
mlewis,
You stated in an in you reply to sanon:
"For the two colors:
You need to find the two colors to use in the registry, then use the DrawGradient API to draw the gradient. One catch: it won't work on labels, so youd need to use a PictureBox instead."
Do you have an example of how to do this that you could make available? What I want to do is display a section at the top of several forms in my program that has a gradient background. For instance: white to light blue, white to light green, etc. Over top of this I want to overlay text with the function of the form, such as "Customer Registration."
I am thinking about using the PictureBox in a manner simialar to what you have mentioned and overlaying that with a label with a transparent background, if that can be done. Any ideas and help here would be most welcomed.
Thanks,
Rev. Michael L. Burns
-
Dec 23rd, 2000, 03:48 AM
#4
Frenzied Member
I don't have one available but I can send you some info if you like.
I think the easiest way to continue this would be by email; my main address is [email protected]
Talk to you soon.
-
Dec 23rd, 2000, 04:07 AM
#5
PowerPoster
sanon, here the sample code.
Code:
Option Explicit
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Const COLOR_ACTIVECAPTION = 2
Private Sub Command1_Click()
Label1.BackColor = GetSysColor(COLOR_ACTIVECAPTION)
End Sub
To know more abt the GetSysColor juz take a look on this MSDN Library
Chris
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
|