color in a rectangle

Posted on 2006-07-13
Last Modified: 2010-04-23
 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 ?
Question by:sirbounty
  • 3

Accepted Solution

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.
LVL 67

Author Comment

ID: 17102586
LVL 67

Author Comment

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

Author Comment

ID: 17108482

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataGridView Events ? 3 47
C# Single Form 8 42
Access to class from any project within a solution. 6 24
send messages to whatsapp programatically 2 49
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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