Click here to Skip to main content
16,016,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to draw a rectangle in picturebox and fill it with color.

Thanks in Advance
CoderDinesh
Posted

See here[^].
 
Share this answer
 
Comments
coderDinesh 5-Aug-11 1:25am    
Your answer is for draw a rectangle. But the question is how to draw a rectangle in picturebox
I suppose your Picture Box is a CStatic. You may use its GetBitmap method and then draw on it, as shown, for instance, in the following article: "Drawing lines, shapes, or text on bitmaps"[^].
 
Share this answer
 
Comments
Albert Holguin 4-Aug-11 21:16pm    
He can always draw on the parent after the parent has drawn everything else out. He doesn't have to GetBitmap.... although he could... just elaborating...
coderDinesh 5-Aug-11 1:37am    
your answer is nearly my question. And it helps to solve my problem
Thank you
CPallini 5-Aug-11 3:47am    
You are welcome.
This is easy to do with the Windows Graphics Device Interface (GDI)... do a search for how to use it (google).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900