Solved

color in a rectangle

Posted on 2006-07-13
4
286 Views
Last Modified: 2010-04-23
Using:
 grpContainer = Graphics.FromHwnd(Me.FindForm.ActiveForm.Handle)

With grpContainer
 .DrawRectangle(penBlue, x0, 20, h0, 80)

how can I 'fill' in the rectangle?

Or is it outside of this particular method's ability ?
0
Comment
Question by:sirbounty
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
Shakti109 earned 125 total points
ID: 17102548

You use a brush and the "fillrectangle method" as follows :


      Dim bluebrush As New SolidBrush(Color.Blue)

      With grpContainer
         .DrawRectangle(penBlue, x0, 20, h0, 80)
         .fillrectangle(bluebrush, x0, 20, h0, 80)
      end with

You can of course change the colors when you declare it to anything you wish.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17102586
trying...
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17102825
Having some difficulty - opening a new Q on it...
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17108482
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question