Skip to main content

Linking One Form To Another Form in VB.NET.(On clicking submit button, display inputted data on a label with proper formatting.)

PROPERTIES:
Form1
RadioButton1
TextMale
RadioButton2
TextFemale
GroupBox1
TextSkills
RadioButton3
TextDevloper
RadioButton4
TextProgrammmer
RadioButton5
TextCoder
Button1
TextSubmit
Button2
TextX
Form2
Button1
TextName
Button2
Namena
Button3
TextAddress
TextBox1
Namead
MultilineTrue
ReadOnlyTrue
Button4
TextSkills
Button5
Names
Button6
TextGender
Button7
Namegen
Button8
Nameok
TextOK
CODEING:
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Form1.ad.Text = TextBox2.Text
        Form1.na.Text = TextBox1.Text
        If RadioButton1.Checked Then
            Form1.gen.Text = RadioButton1.Text
        Else
            Form1.gen.Text = RadioButton2.Text
        End If
        If RadioButton3.Checked Then
            Form1.s.Text = RadioButton3.Text
        ElseIf RadioButton4.Checked Then
            Form1.s.Text = RadioButton4.Text
        Else
            Form1.s.Text = RadioButton5.Text
        End If
        Form1.Show()
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles x.Click
        Me.Close()

    End Sub
End Class
Public Class Form2
    Private Sub ok_Click(sender As Object, e As EventArgs) Handles ok.Click
        Form1.Close()
    End Sub
End Class
DESIGNING:


Comments