R
roger.breton
Guest
Here is my FormLoad code:
Private Sub myApp_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Var0 As Single = SomeFunction(50, 40, 40, 50, 54.25, 45)
tbVar1.Text = 50
tbVar2.Text = 40
tbVar3.Text = 40
DrawGraph()
PictureBox6.Invalidate()
End Sub
At first sight, nothing fancy. What happens is that on my Form, there is a PictureBox control ("PictureBox6").
The call to the DrawGraph() Sub contains the code to draw on that PictureBox control. It goes like this :
Private Sub DrawToleranceGraph()
Dim g = PictureBox6.CreateGraphics()
g.Clear(Color.LightGray)
Dim FondBlanc As New SolidBrush(Color.White)
Dim WhiteMargin As Single = 15
g.FillRectangle(FondBlanc, WhiteMargin, WhiteMargin, PictureBox6.Width - 2 * WhiteMargin, PictureBox6.Height - 2 * WhiteMargin)
Dim blackPen = New Pen(Color.FromArgb(128, 128, 128), 1)
Dim blackPen2pix = New Pen(Color.FromArgb(64, 64, 64), 2)
Dim EllipsePen = New Pen(Color.FromArgb(0, 128, 255), 3)
And there is more code to draw on that PictureBox control.
The problem I run into is that the PictureBox refuses to display when it is called from FormLoad?
I tried Invalidate() to no avail.
Continue reading...
Private Sub myApp_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Var0 As Single = SomeFunction(50, 40, 40, 50, 54.25, 45)
tbVar1.Text = 50
tbVar2.Text = 40
tbVar3.Text = 40
DrawGraph()
PictureBox6.Invalidate()
End Sub
At first sight, nothing fancy. What happens is that on my Form, there is a PictureBox control ("PictureBox6").
The call to the DrawGraph() Sub contains the code to draw on that PictureBox control. It goes like this :
Private Sub DrawToleranceGraph()
Dim g = PictureBox6.CreateGraphics()
g.Clear(Color.LightGray)
Dim FondBlanc As New SolidBrush(Color.White)
Dim WhiteMargin As Single = 15
g.FillRectangle(FondBlanc, WhiteMargin, WhiteMargin, PictureBox6.Width - 2 * WhiteMargin, PictureBox6.Height - 2 * WhiteMargin)
Dim blackPen = New Pen(Color.FromArgb(128, 128, 128), 1)
Dim blackPen2pix = New Pen(Color.FromArgb(64, 64, 64), 2)
Dim EllipsePen = New Pen(Color.FromArgb(0, 128, 255), 3)
And there is more code to draw on that PictureBox control.
The problem I run into is that the PictureBox refuses to display when it is called from FormLoad?
I tried Invalidate() to no avail.
Continue reading...