|
-
Mar 22nd, 2004, 11:53 AM
#1
Thread Starter
Hyperactive Member
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.
-
Mar 23rd, 2004, 07:07 PM
#2
Member
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
-
Mar 23rd, 2004, 10:30 PM
#3
Thread Starter
Hyperactive Member
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.
-
Mar 24th, 2004, 05:25 PM
#4
Member
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
-
Mar 24th, 2004, 10:08 PM
#5
Thread Starter
Hyperactive Member
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:
SetBkMode Form1.hdc, 2
SetBkColor Form1.hdc, RGB(0, 0, 255)
Dim hBrush As Long
hBrush = CreateSolidBrush(RGB(0, 0, 255))
SetBkColor GetDC(hBrush), RGB(0, 0, 255)
SelectObject Form1.hdc, hBrush
DeleteObject hBrush
dargb = CreateRectRgn(0, 0, 1024, 1024)
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.
-
Mar 25th, 2004, 06:22 PM
#6
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|