How to draw Line or Dot in Picturebox ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi !
I always appreciate your help.
I've some question in Picturebox.

At First, My develop environment is VB.net / iPaq5550(ppc2003).
I Know only Vb.net a little.

I want draw some dot or Line in picturebox on form
for instance, I receive some data at comport per 1sec.
so, I want draw continued dot or line in Picturebox that has image already.

Or, trace mouse moving position in picturebox.

I tried to draw with "picturebox_paint", "e.graphics".
but This question is as much in dark as ever.

Please, some example code or rererence.

Goodluck.......
 
simple.
DON'T DRAW on a picture box !

eventually you could try to do it anyway like that
class MyPictureBox : PictureBox
{
protected override void OnPaint(PaintEventArgs pea)
{
base.OnPaint(pea);
// do your stuff here
}
}

but that's hazardous, CF controls (Except SWF.Control itself) doesn't seem
to go through all the method properly.
Why don't you (and so should you in fact) write your own control ?!

public class MyDotControl : Control
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
// do your drawing here ...
}
}
 
Back
Top