troubleshooting Question

Learning VB

Avatar of madhatter5501
madhatter5501Flag for United States of America asked on
Visual Basic Classic
4 Comments1 Solution334 ViewsLast Modified:
I am trying to learn VB and am trying to create a simple form with the following code, what am I doing wrong?  and if anyone has any input on how to learn VB I would appreciate the direction.

Public Class Form1

    Dim msg As String
    Dim title As String
    Dim style As MsgBoxStyle
    Dim response As MsgBoxResult


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

   

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub

   

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("ok", MsgBoxStyle.OkCancel)
        If MsgBoxResult.Ok Then
            Close()
                 else
                   If MsgBoxResult.Cancel Then
                   MsgBox("are you sure you want to cancel", MsgBoxStyle.YesNo)
            End If
        End If
    End Sub
End Class
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros