AdvancedHMI Software
General Category => Support Questions => Topic started by: Darrell on August 31, 2015, 08:12:56 AM
-
I used this code that i found on this forum and I maybe missing something.
when i click a button to toggle a bit the message pops up with a yes or no question but the bit still toggles before I answer.
If MsgBox("Are you sure?", Microsoft.VisualBasic.MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
EthernetIPforPLCSLCMicroCom1.Write("B3/100", "1")
End If
Darrell
-
I used this code that i found on this forum and I maybe missing something.
when i click a button to toggle a bit the message pops up with a yes or no question but the bit still toggles before I answer.
If MsgBox("Are you sure?", Microsoft.VisualBasic.MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
EthernetIPforPLCSLCMicroCom1.Write("B3/100", "1")
End If
Darrell
Darrell,
I think this may work:
If
MsgBox("Are you sure?", Microsoft.VisualBasic.MsgBoxStyle.YesNo)
EndIf
If
MsgBoxResult.Yes Then
EthernetIPforPLCSLCMicroCom1.Write("B3/100", "1")
End If
-
I couldn't have that code work but this one did work:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim result As MsgBoxResult = MsgBox("Are you sure?", Microsoft.VisualBasic.MsgBoxStyle.YesNo)
If result = MsgBoxResult.Yes Then
EthernetIPforPLCSLCMicroCom1.Write("B3/100", "1")
End If
End Sub