|
-
Sep 29th, 2000, 05:12 PM
#1
Okay... I searched but really don't know what to search for...
How do you get the colors at the top of the form to go from dark blue to a lighter blue at the other end???
Is there a specific property to do this or is it a third-party add-on???
Thanks!
-
Sep 29th, 2000, 05:14 PM
#2
PowerPoster
Use API
I have tried this before and the only answer is API, but it will change all forms on the system. You will need to save the current values, then restuore them if you only want the effect for your app.
Can anyone help with the correct code?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Sep 29th, 2000, 05:17 PM
#3
Add the following to your Form
Code:
Sub Dither(vForm As Form)
Dim intLoop As Integer
vForm.DrawStyle = vbInsideSolid
vForm.DrawMode = vbCopyPen
vForm.ScaleMode = vbPixels
vForm.DrawWidth = 2
vForm.ScaleHeight = 256
For intLoop = 0 To 255
vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(0, 0, 255 - intLoop), B
Next intLoop
End Sub
Private Sub Form_Activate()
Me.AutoRedraw = True
End Sub
Private Sub Form_Resize()
Dither Me
End Sub
-
Sep 29th, 2000, 05:32 PM
#4
Sweet code Megatron!
But it changed the background of my form from a blue at the top to a deep blue/black at the bottom.
I was interested in seeing how to change the title bar of the form. From dark blue on the left to a lighter blue on the right.
But I will save the snippet of code you sent for later uses and study.
Thanks!
-
Sep 29th, 2000, 05:37 PM
#5
Hyperactive Member
That is really cool Megatron. I will defintly be using that in other progs from now on. If i can just modify it a little. Hopefully I will be able to figure it out on my own. Thanks!!
As for the title bar the only way I have heard of(i don't know how to do it personally) is exactly what James Stanich said. You would have to use Api to get the current settings (so you can change them back when you are done) then change the settings using Api and then when your program exits change it back to its original settings. I am sorry I don't know the code for it though.
-
Sep 29th, 2000, 06:00 PM
#6
You could make your own title bar.
Here is the results I found from searching planet source code forcustom titlebar
-
Sep 29th, 2000, 06:15 PM
#7
You can use these APIs:
Code:
Public Declare Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Long) As Long
Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Use GetWindowDC to get the handle of the device-context for the whole window. Use SystemParametersInfo to get the height of the title bar and the border of a window, and combine them with Megatron's code above.
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
|