Author Topic: 'popup" with control  (Read 1112 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
'popup" with control
« on: December 29, 2014, 10:02:25 PM »
I am trying to create someway to have an acknowledgement message or "popup" that has controls on it.  As in if I add a "TEST" button and press it then a message appears that says "ARE YOU SURE".  On this message is the BasicButton "YES" that actually initiates the test.  I figure I can just create another form and show/hide it but i was trying to avoid creating more drivers/subscriptions to the same device Im already communicating with.  how can I do this in the same form that is already open?  thanks 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: 'popup" with control
« Reply #1 on: December 29, 2014, 10:28:30 PM »
- Add a Button to your form from the All Windows Forms group
- Double click the button and add the code:

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If MsgBox("Are you sure?", Microsoft.VisualBasic.MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
            ModbusRTUCom1.Write("40001", "1")
        End If
    End Sub