I am receiving a integer from a microcontroller through RS232 and everything on that seems to be working fine! However I have some case statements depending on the int received that "set picture boxes to visible". The problem is they are not becoming visible. However when I step through the code it enters the correct case statements and thier state becomes visible?? So maybe I am not updating or the timing is off and I just can not seem them on the screen change?? Here is a snippet of the code any help will be greatly appreciated!! I am sure it has something to do with the RS232 code part of it.
T_RS232.Read(1)
System.Threading.Thread.Sleep(500)
datas = T_RS232.InputStream()
ctl.Update()
System.Threading.Thread.Sleep(500)
If datas(0) > 0 & datas(0) < 33 Then
Me.Display_Lcd.Text = "Aquiring Sensor" + datas(0) + ".."
Me.Display_Lcd.Update()
System.Threading.Thread.Sleep(500)
Sensor(datas, cntr) //ENTERS SUBPROGRAM THAT SETS PBOX TO TRUE
ctl.Update()
System.Threading.Thread.Sleep(500)
EndIf
SENSOR SUB PROGRAM
Case 1
Me.PictureBox31.Visible = True
PictureBox31.Update()
System.Threading.Thread.Sleep(50)
RETURNS TO BEGINNING TO GET NEXT INT
T_RS232.Read(1)
System.Threading.Thread.Sleep(500)
datas = T_RS232.InputStream()
ctl.Update()
System.Threading.Thread.Sleep(500)
If datas(0) > 0 & datas(0) < 33 Then
Me.Display_Lcd.Text = "Aquiring Sensor" + datas(0) + ".."
Me.Display_Lcd.Update()
System.Threading.Thread.Sleep(500)
Sensor(datas, cntr) //ENTERS SUBPROGRAM THAT SETS PBOX TO TRUE
ctl.Update()
System.Threading.Thread.Sleep(500)
EndIf
SENSOR SUB PROGRAM
Case 1
Me.PictureBox31.Visible = True
PictureBox31.Update()
System.Threading.Thread.Sleep(50)
RETURNS TO BEGINNING TO GET NEXT INT