Can anyone help me with this syntax.. i made 3 forms. and i want form 1 & 2 inputs displayed in form 3.. this is what i made so far.. don't know what to do next
Form 1
Public Class Form1
Inherits System.Windows.Forms.Form
Dim ID, sname, course1, year1 As String
Dim frm3 As New Form3
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
ID = TextBox1.Text
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
sname = TextBox2.Text
End Sub
Private Sub ComboBox1_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.DropDown
If ComboBox1.MaxDropDownItems > 5 Then
ComboBox1.Items.Add("BSCoE")
ComboBox1.Items.Add("BSCS")
ComboBox1.Items.Add("DIT")
ComboBox1.Items.Add("DCET")
ComboBox1.Items.Add("HRS")
ComboBox1.MaxDropDownItems = 5
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
course1 = ComboBox1.Text
If course1 = "BSCoE" Then
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1st year")
ComboBox2.Items.Add("2nd year")
ComboBox2.Items.Add("3rd year")
ComboBox2.Items.Add("4th year")
ComboBox2.Items.Add("5th year")
ComboBox2.MaxDropDownItems = 5
ElseIf course1 = "BSCS" Then
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1st year")
ComboBox2.Items.Add("2nd year")
ComboBox2.Items.Add("3rd year")
ComboBox2.Items.Add("4th year")
ComboBox2.MaxDropDownItems = 4
ElseIf course1 = "DIT" Then
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1st year")
ComboBox2.Items.Add("2nd year")
ComboBox2.MaxDropDownItems = 2
ElseIf course1 = "DCET" Then
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1st year")
ComboBox2.Items.Add("2nd year")
ComboBox2.MaxDropDownItems = 2
ElseIf course1 = "HRS" Then
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1st year")
ComboBox2.Items.Add("2nd year")
ComboBox2.MaxDropDownItems = 2
End If
year1 = ComboBox2.Text
End Sub
Private _id1 As String
Public Property [ID1]() As String
Get
Return _id1
End Get
Set(ByVal Value As String)
ID = _id1
End Set
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2
frm2.ShowDialog()
Me.Hide()
End Sub
End Class
Form 2
Public Class Form2
Inherits System.Windows.Forms.Form
Dim address, bdate, age, contact As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm3 As New Form3
frm3.ShowDialog()
Me.Hide()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.Text = address
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox1.Text = contact
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox1.Text = bdate
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
TextBox1.Text = age
End Sub
End Class
Form 3
Public Class Form3
Inherits System.Windows.Forms.Form
Dim ID2, sname1, course2, year2 As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Obj As New Form1
Obj.ID1 = ID2
ID2 = TextBox1.Text
End Sub
End Class