Results 1 to 7 of 7

Thread: Changing colors on the top of the form

  1. #1
    Guest

    Exclamation

    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!

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    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....

  3. #3
    Guest
    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

  4. #4
    Guest

    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!

  5. #5
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408
    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.
    Sincerely,
    Chris


    Email: [email protected]
    AIM: KnightsOfTheMoon
    WebPage: http://kom.wicre.com
    ----------------
    VB6 Professional
    Abit ST6-RAID
    1000 MHZ
    512 MB PC133 Ram
    Nvidia GeForce 2 Ultra 64 MB
    Maxtor 81.9 Gig
    Win 98 SE

  6. #6
    Guest
    You could make your own title bar.

    Here is the results I found from searching planet source code forcustom titlebar

  7. #7
    Guest
    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
  •  



Click Here to Expand Forum to Full Width