-
September 5th, 2006, 02:27 AM
#1
GUI : Drawing a line on Dialog?
I'm using VS 2005
i want to draw a line on the dialog ,not from the code, but from the toolbox.
isn't there a way to draw a line on the dialog by a control on the toolbox ?
-
September 5th, 2006, 03:24 AM
#2
Re: GUI : Drawing a line on Dialog?
Nope. You have to draw the line programatically using System.Drawing
Daniela
******
I would love to change the world, but they won't give me the source code
-
September 5th, 2006, 03:27 AM
#3
Re: GUI : Drawing a line on Dialog?
-
September 5th, 2006, 03:37 AM
#4
Re: GUI : Drawing a line on Dialog?
There isn't a standard control, but you can easily create a UserControl to do that.
1) Add a new UserControl to your project.
2) In the onPaint eventhandler of the usercontrol put this code:
Code:
private void UserControl2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen p = new Pen(Color.Black);
int width = ClientRectangle.Width;
int height= ClientRectangle.Height;
g.DrawLine( p, 0, 0, width , 0 );
p.Dispose();
}
3) Compile and use
That might be handier when using multiple lines...
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
|