A
Andy Roxburgh
I have run out of labels in my VB.NET NETCF application,
it only accepts about 100. I asked on here if there was
another way of drawing text on the screen, and John kirk
gave me this code snippet, which draws text on refresh:
Handles PictureBox1.Paint
which does the job nicely, but now I want to draw text
that's continually changing, i.e. it doesn't wait for the
form to be refreshed. I've been told to use
Me.CreateGraphics to get a graphics object, eg...
Dim g As Graphics = Me.CreateGraphics()
which is fine when the display area is just a form, but I
am now using a TabControl, and I need to draw the text on
to a TabPage. (called in this case TabPage_Road). Is it
simple to do that?
And just to complicate things further...
The application is now multithreaded and the updating is
being done from a worker thread. Does this introduce other
issues?
oh and while I'm on a roll.. one more thing...
I've got a memory leak which I suspect is coming from the
multithreading code. Any advice on tracking down these
monsters?
I'm not a hardened VB.NET expert as you may have gathered;
C and VB6 were my specialities!
Thanks
Andy
it only accepts about 100. I asked on here if there was
another way of drawing text on the screen, and John kirk
gave me this code snippet, which draws text on refresh:
Object, ByVal e As System.Windows.Forms.PaintEventArgs)Private mstrMessage as String
Private Sub PictureBox1_Paint(ByVal sender As
Handles PictureBox1.Paint
If mstrMessage <> "" Then
Dim f As Font
Dim b As Brush
Dim r As RectangleF
r = New RectangleF(5, 5, 200, 20)
f = New Font("Arial", 10, FontStyle.Bold)
b = New SolidBrush(Color.White)
e.Graphics.DrawString(mstrMessage, f, b, r)
End If
End Sub
which does the job nicely, but now I want to draw text
that's continually changing, i.e. it doesn't wait for the
form to be refreshed. I've been told to use
Me.CreateGraphics to get a graphics object, eg...
Dim g As Graphics = Me.CreateGraphics()
which is fine when the display area is just a form, but I
am now using a TabControl, and I need to draw the text on
to a TabPage. (called in this case TabPage_Road). Is it
simple to do that?
And just to complicate things further...
The application is now multithreaded and the updating is
being done from a worker thread. Does this introduce other
issues?
oh and while I'm on a roll.. one more thing...
I've got a memory leak which I suspect is coming from the
multithreading code. Any advice on tracking down these
monsters?
I'm not a hardened VB.NET expert as you may have gathered;
C and VB6 were my specialities!
Thanks
Andy