Linking One Form To Another Form in VB.NET.(On clicking submit button, display inputted data on a label with proper formatting.)
PROPERTIES:
CODEING:
| Form1 | |
| RadioButton1 | |
| Text | Male |
| RadioButton2 | |
| Text | Female |
| GroupBox1 | |
| Text | Skills |
| RadioButton3 | |
| Text | Devloper |
| RadioButton4 | |
| Text | Programmmer |
| RadioButton5 | |
| Text | Coder |
| Button1 | |
| Text | Submit |
| Button2 | |
| Text | X |
| Form2 | |
| Button1 | |
| Text | Name |
| Button2 | |
| Name | na |
| Button3 | |
| Text | Address |
| TextBox1 | |
| Name | ad |
| Multiline | True |
| ReadOnly | True |
| Button4 | |
| Text | Skills |
| Button5 | |
| Name | s |
| Button6 | |
| Text | Gender |
| Button7 | |
| Name | gen |
| Button8 | |
| Name | ok |
| Text | OK |
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: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
Comments
Post a Comment