VB .NET

VB .NET

Slip14

Q.1)  Write a Vb.net program to design the following form, select the question number from combo box that question will be displayed into textbox and the options for that question will be displayed on four radio buttons, select option and click on submit button result should be displayed in another textbox. [Marks 20] 

Solution

Public Class Slip14

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        MsgBox(ComboBox1.SelectedItem)

        If ComboBox1.Text = "Question 1" And RadioButton1.Checked Then

            TextBox1.Text = "Answer is Correct"

        ElseIf ComboBox1.Text = "Question 2" And RadioButton3.Checked Then

            TextBox1.Text = "Answer is Correct"

        Else

            TextBox1.Text = "Answer is Wrong"

        End If

    End Sub


    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

        If ComboBox1.Text = "Question 1" Then

            RichTextBox1.Text = "Which is capital of India?"

            RadioButton1.Text = "Delhi"

            RadioButton2.Text = "Mumbai"

            RadioButton3.Text = "Pune"

            RadioButton4.Text = "Channai"

        ElseIf ComboBox1.Text = "Question 2" Then

            RichTextBox1.Text = "Which is Capital of Maharashtra"

            RadioButton1.Text = "Delhi"

            RadioButton2.Text = "Mumbai"

            RadioButton3.Text = "Nagpur"

            RadioButton4.Text = "Channai"

        End If

    End Sub

End Class

BCA Pratical Solution

My name is Vivek And I from Mumbai and Complete my Graduation Bca.my Age is 23 Years.

Post a Comment

Previous Post Next Post