Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 textboxes, namely NQ, TPQ and ET. NQ allows the user to enter a specified number of question (1 to 100), TPQ display the time per each question and its given as 30seconds, the ET calculate and display the total time for the specified set of question. TPQ doesn't display the Time per question in it textbox until a value is provided, then it displays the Time as 30seconds. please I want it to be done automatically as soon as a user specifies the number of question in the NQ textbox.

2. I want to calculate the to the Total for a specified number of questions.

below is what I have tried for the first part.

What I have tried:

VB

Private Sub Course_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles Course.SelectedIndexChanged
        If Course.Text = "Microsoft" Then
            Type.SelectedItem = ("Windows Server")
            Category.SelectedItem = ("All Windows Server Exams")
        ElseIf Course.Text = "Cisco Associate" Then
            Type.SelectedItem = ("Cisco CCNA")
            Category.SelectedItem = ("All CCNA Exams")
        ElseIf Course.Text = "Cisco Professional" Then
            Type.SelectedItem = ("Cisco CCNP")
            Category.SelectedItem = ("All CCNP Exams")
        ElseIf Course.Text = "CompTIA Hardware" Then
            Type.SelectedItem = ("CompTIA A+")
            Category.SelectedItem = ("CompTIA A+")
        ElseIf Course.Text = "CompTIA Security" Then
            Type.SelectedItem = ("CompTIA Sec+")
            Category.SelectedItem = ("CompTIA Sec+")
        End If
    End Sub

    Private Sub NQ_TextChanged(sender As Object, e As EventArgs) Handles NQ.TextChanged
        If NQ.Text < 100 Or NQ.Text = 0 Then
        ElseIf NQ.Text > 100 Then
            MessageBox.Show("Maximum question is 100")
        ElseIf IsNumeric(NQ.Text) Then
        End If

    End Sub

    Private Sub TPQ_TextChanged(sender As Object, e As EventArgs) Handles TPQ.TextChanged
        Dim seconds As Double
        seconds = 30
        TPQ.Text = seconds & " seconds"
    End Sub

    Private Sub ET_TextChanged(sender As Object, e As EventArgs) Handles ET.TextChanged

    End Sub

Posted
Updated 28-Apr-19 3:49am

1 solution

Why does TPQ have a text changed handler when it is being used for "display"?

Update TPQ from NQ's text changed, if NQ's value is valid.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900