Link to home
Start Free TrialLog in
Avatar of madhatter5501
madhatter5501Flag for United States of America

asked on

Learning VB

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
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of madhatter5501

ASKER

only half the question was answered, the formula works good though.
...what else did you need to know?
I am looking for the best way to learn VB - Free Websites, Programs...  I'll post another link for more points since this is closed.