Results 1 to 6 of 6

Thread: Changins a brush's background color

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    Someplace 'ore the rainbow
    Posts
    392

    Changins a brush's background color

    How do I change a brush's background color?

    cjqp
    When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.

  2. #2
    Member
    Join Date
    Mar 2004
    Location
    Texas
    Posts
    53
    cjqp, I looked for answers to your question, and came up with nothing, do you mean "How do I change a control's background color?"
    Good programming site:
    *http://www.planet-source-code.com

    Our CS Clan Page:
    *http://h2p.inter-gamer.com/index.html

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    Someplace 'ore the rainbow
    Posts
    392
    No, here (this is from Dan Appleman's API book):
    -Under PaintRgn-
    "This function fills the specified region using the current brush background color."

    cjqp
    When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.

  4. #4
    Member
    Join Date
    Mar 2004
    Location
    Texas
    Posts
    53
    Ok I looked in my giant VB API book and I found what you need to use: 'SetBkColor' will set the background for a brush. Here's a few links I found that do this, but I'm not sure what your doing:
    http://www.listensoftware.com/hrxp/c...?contentid=581
    http://www.vbapihelpline.de/ref/func...Color&Letter=s Last link is in German, but if you look at the code you should get the idea
    http://www.developersdex.com/vb/mess...p13.phx.gbl%3E On this 1, ctrl+f to find ''SetBkColor"
    I hope this gives you a decent idea or direction of where to go.
    Good programming site:
    *http://www.planet-source-code.com

    Our CS Clan Page:
    *http://h2p.inter-gamer.com/index.html

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    Someplace 'ore the rainbow
    Posts
    392
    Thanks for the help so far! What I'm trying to do is set up a program that will color another window's bg. I have tried the SetBkColor/Mode API, and through what I have discovered I need:
    VB Code:
    1. SetBkMode Form1.hdc, 2
    2. SetBkColor Form1.hdc, RGB(0, 0, 255)
    3.  
    4. Dim hBrush As Long
    5. hBrush = CreateSolidBrush(RGB(0, 0, 255))
    6.  
    7. SetBkColor GetDC(hBrush), RGB(0, 0, 255)
    8. SelectObject Form1.hdc, hBrush
    9. DeleteObject hBrush
    10.  
    11. dargb = CreateRectRgn(0, 0, 1024, 1024)
    12. PaintRgn Form1.hdc, dargb

    This won't color the form, but commenting out the SelectObject line will color the form the selected FillColor.

    Any other ideas?

    cjqp
    When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.

  6. #6
    Member
    Join Date
    Mar 2004
    Location
    Texas
    Posts
    53
    I'm still looking, here's an example of coloring a component using CShape, mabey you could use that some how?
    http://www.vb-helper.com/howto_set_frame_backcolor.html
    Using the '[Form].BackColor' you can directly change the form's background without using brushes, but not sure how to do so for a different app. http://www.visualbasicforum.com/showthread.php?t=133832
    And finally this example looked the most intresting, yet I can't figure out what message needs to be sent instead of "TVM_SETBKCOLOR", so you may have to give it some time. http://www.vb-helper.com/tut10.htm I looked pretty hard and it seems like this topic is a lil scarce on resources. There's plenty of tuts on how to change the backgound color of controls but not the actual forms. Good luck!
    Good programming site:
    *http://www.planet-source-code.com

    Our CS Clan Page:
    *http://h2p.inter-gamer.com/index.html

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