dialog box doesnt load gives a runtime exception!

ethicalhacker

Well-known member
Joined
Apr 22, 2007
Messages
142
Location
Delhi,India
Programming Experience
5-10
VB.NET:
Imports System.Windows.Forms

Public Class Dialog1
    Dim a As String = ListBox1.SelectedItem
    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub Dialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'BillingDataSet3.airlines' table. You can move, or remove it, as needed.
        Me.AirlinesTableAdapter.Fill(Me.BillingDataSet3.airlines)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Select Case (a)
        '    Case "flight_details"
        'Form3.DataGridView1.Columns.Add("FlightdetailsDataGridViewTextBoxColumn", "Flight Details")
        '   Case "passenger_name"
        ' Form3.DataGridView1.Columns.Remove("PassengernameDataGridViewTextBoxColumn")
        '    Case "sector"
        'Form3.DataGridView1.Columns.Remove("SectorDataGridViewTextBoxColumn")
        '   Case "airline_name"
        'Form3.DataGridView1.Columns.Remove("AirlinenameDataGridViewTextBoxColumn")
        '   Case "class"
        'Form3.DataGridView1.Columns.Remove("ClassDataGridViewTextBoxColumn")
        'End Select
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Select Case (a)
            Case "flight_details"
                Form3.DataGridView1.Columns.Remove("FlightdetailsDataGridViewTextBoxColumn")
            Case "passenger_name"
                Form3.DataGridView1.Columns.Remove("PassengernameDataGridViewTextBoxColumn")
            Case "sector"
                Form3.DataGridView1.Columns.Remove("SectorDataGridViewTextBoxColumn")
            Case "airline_name"
                Form3.DataGridView1.Columns.Remove("AirlinenameDataGridViewTextBoxColumn")
            Case "class"
                Form3.DataGridView1.Columns.Remove("ClassDataGridViewTextBoxColumn")
        End Select
    End Sub
End Class
the dialogbox doesnt load it just gives InvalidOperationException whats wrong? I have no idea
 
Back
Top