I have two labels in form4 associated with two variables in form1:
Public Class Form1
.....
Form4.Label1.Text = FormatNumber(COR8(0, 0), 4)
Form4.Label2.Text = FormatNumber(COR8(4, 0), 4)
.....
End Class
and I also have another two labels in the same form4 associated with the same variables the following way:
Public Class Form4
Dim COR8f1(,) As Double = Form1.COR8 'which is Public Shared
Private Sub Form4_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
Dim corx, cory As Single
corx = COR8f1(0, 0) : cory = COR8f1(4, 0)
Label3.Text = corx
Label4.Text = cory
End Sub
It happens that Label1.text and Label2.text are immediately updated, but the same does not happen to Label3.text and Label4.text which sometimes update and sometimes don't. I mean, sometimes all labels update at the same time and sometimes it takes 3 or 4 times for labels 3 and 4 to update.
It is obvious that I'm doing sth wrong.
I use Private Sub Form4_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint because I'm drawing a graph that doesn't update unless I reload the form.
Thank you very much for your patience.
Public Class Form1
.....
Form4.Label1.Text = FormatNumber(COR8(0, 0), 4)
Form4.Label2.Text = FormatNumber(COR8(4, 0), 4)
.....
End Class
and I also have another two labels in the same form4 associated with the same variables the following way:
Public Class Form4
Dim COR8f1(,) As Double = Form1.COR8 'which is Public Shared
Private Sub Form4_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
Dim corx, cory As Single
corx = COR8f1(0, 0) : cory = COR8f1(4, 0)
Label3.Text = corx
Label4.Text = cory
End Sub
It happens that Label1.text and Label2.text are immediately updated, but the same does not happen to Label3.text and Label4.text which sometimes update and sometimes don't. I mean, sometimes all labels update at the same time and sometimes it takes 3 or 4 times for labels 3 and 4 to update.
It is obvious that I'm doing sth wrong.
I use Private Sub Form4_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint because I'm drawing a graph that doesn't update unless I reload the form.
Thank you very much for your patience.
Last edited: