drawing ellipse

  • Thread starter Thread starter Xavier Valdés
  • Start date Start date
X

Xavier Valdés

Hi all,

I'm trying to draw an ellipse in my form but I'm not able to do that.
Dim cPiPen As New Pen(Color.Magenta, 3)

Me.CreateGraphics.DrawEllipse(cPiPen, 0.0F, 0.0F, 300.0F, 300.0F)

The problem is when I put these lines in my form_load method nothing is
drawed.

Any ideas?

Thanks

xavi
 
Xavier Valdés said:
I'm trying to draw an ellipse in my form but I'm not able to do that.
Dim cPiPen As New Pen(Color.Magenta, 3)

Me.CreateGraphics.DrawEllipse(cPiPen, 0.0F, 0.0F, 300.0F, 300.0F)

The problem is when I put these lines in my form_load method nothing is
drawed.

"drawed" -> "drawn" :-).

Instead of adding the code to the form's 'Load' event handler, add it to its
overridden 'OnPaint' method or the 'Paint' event handler:

\\\
e.Graphics.DrawEllipse(...)
///
 
Thanks 4 correction!
I'm trying to draw it in my OnPaint method but nothing happens.
Perhaps the problem is that my application is not an exe but a .net
component.
Any ideas?
Thanks,
Xavi
 
Xavier Valdés said:
I'm trying to draw it in my OnPaint method but nothing happens.
Perhaps the problem is that my application is not an exe but a .net
component.

Components don't have a graphical interface. You'll have to add the code to
a form or control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top