Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

color in a rectangle

Posted on 2006-07-13
4
Medium Priority
?
291 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview
Suggested Courses

916 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