|
-
Jun 5th, 2004, 06:38 AM
#1
Thread Starter
Lively Member
How to draw a rectangle on a control
Hi everyone
I want to draw a rounded rectangle on a TabControl page. I've tried using .CreateGraphics method but nothing happens. (I also need to draw a line)
I can draw on the form ok but i can't draw on the tabpage, I tried using paint events(base OnPaint) but there's no paint event for the TabControl so does anyone know how this can be done?
I also want to draw a line across a listview but like the TabControl this doesn't work either.
Can anyone help?
-
Jun 6th, 2004, 05:43 AM
#2
Thread Starter
Lively Member
Ignore this, I just called the OnPaint event again and it now draws the rounded rectangle and line ok.
-
Jun 6th, 2004, 12:33 PM
#3
Sleep mode
Every control that inherits Control class has Graphics object associated with it . It's called CreateGraphics that acts like a graphics object which is used for drawing different shapes . It has also ready to used methods (Draw... , Fill.....) .
You can do this for example :
VB Code:
Label.CreateGraphics().DrawLine(..........) .
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
|