Images and drawing stuff. How???

  • Thread starter Thread starter KC
  • Start date Start date
K

KC

This is a stupid question, but how do you (can you) 'draw' on a form? I just
want to highlight or enhance parts of a form with a line here, a box there,
etc. This was once possible on earlier versions of VB (I recently bought
VB.net, my last one before this was VB4).

I have my image editor toolbar, but everything is greyed out. I know (hope)
this is something simple. MS seems to have made all the little 'simple'
things in VB hard. I understand there's more power, but it's hard after
being away for a few years.

Ken
 
KC said:
This is a stupid question, but how do you (can you) 'draw' on a form?
I just want to highlight or enhance parts of a form with a line here,
a box there, etc. This was once possible on earlier versions of VB (I
recently bought VB.net, my last one before this was VB4).

I have my image editor toolbar, but everything is greyed out. I know
(hope) this is something simple. MS seems to have made all the little
'simple' things in VB hard. I understand there's more power, but it's
hard after being away for a few years.

Simple things have been removed. ;-)

The image editor is for editing images only. On a Form, you can only put
controls. To draw on a control (a Form is a control), override Sub OnPaint
or handle the Paint event:


Private Sub Form1_Paint(ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles MyBase.Paint

e.Graphics.DrawLine(Pens.Red, 0, 0, 50, 50)

End Sub


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top