Click here to Skip to main content
15,913,685 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to enable/disable & list network adapter in VB. Pin
Dave Kreskowiak21-Apr-05 7:17
mveDave Kreskowiak21-Apr-05 7:17 
GeneralRe: How to enable/disable & list network adapter in VB. Pin
Anonymous21-Apr-05 7:21
Anonymous21-Apr-05 7:21 
GeneralRe: How to enable/disable & list network adapter in VB. Pin
Dave Kreskowiak21-Apr-05 7:32
mveDave Kreskowiak21-Apr-05 7:32 
GeneralRe: How to enable/disable & list network adapter in VB. Pin
Scott Serl21-Apr-05 8:32
Scott Serl21-Apr-05 8:32 
GeneralVariables, <>, and IF Statements Pin
Anonymous21-Apr-05 5:34
Anonymous21-Apr-05 5:34 
GeneralRe: Variables, <>, and IF Statements Pin
Dave Kreskowiak21-Apr-05 6:32
mveDave Kreskowiak21-Apr-05 6:32 
GeneralRe: Variables, <>, and IF Statements Pin
Anonymous21-Apr-05 6:49
Anonymous21-Apr-05 6:49 
GeneralRe: Variables, <>, and IF Statements Pin
Dave Kreskowiak21-Apr-05 7:30
mveDave Kreskowiak21-Apr-05 7:30 
Well, in the interest of teaching, I'll rewrite your entire application. Now, if this is homework, don't even think of trying to turn this in. Your prof WILL KNOW you didn't write it! Especially if your next project gets turned in looking nothing like this one!
Option Explicit
Dim Num1 As Long
Dim Num2 As Long
Dim Total As Long
Dim TotalQuestions As Long
Dim CorrectAnswers As Long

Private Sub cmdExit_Click()
    End
End Sub

Private Sub cmdNext_Click()
    TotalQuestions = TotalQuestions + 1
    If CLng(TxtResponse.Text) <> Total Then
        lblMessage = "Wrong"
    Else
        lblMessage = "Correct"
        CorrectAnswers = CorrectAnswers + 1
    End If

    TxtResponse.Text = ""
    lblScore = (CorrectAnswers / TotalQuestions) * 100
End Sub

Private Sub Form_Load()
    Randomize Timer
End Sub

Private Sub GenerateNewTest()
    Num1 = int(Rnd * 11)
    Num2 = int(Rnd * 11)
    Total = Num1 + Num2
    lblNum1 = Num1
    lblNum2 = Num2
End Sub

This is still nowhere near correct coding practices, but you should get the general idea from this...


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Variables, &lt;&gt;, and IF Statements Pin
Anonymous22-Apr-05 6:52
Anonymous22-Apr-05 6:52 
GeneralCR Help Pin
vertig073021-Apr-05 4:38
vertig073021-Apr-05 4:38 
GeneralRe: CR Help Pin
Jim Matthews21-Apr-05 5:20
Jim Matthews21-Apr-05 5:20 
GeneralRe: CR Help Pin
vertig073021-Apr-05 5:46
vertig073021-Apr-05 5:46 
GeneralRe: CR Help Pin
Jim Matthews21-Apr-05 8:04
Jim Matthews21-Apr-05 8:04 
GeneralRe: CR Help Pin
vertig073021-Apr-05 8:21
vertig073021-Apr-05 8:21 
Questionhow to use the WMA codec in my application? Pin
ndanya20-Apr-05 23:20
ndanya20-Apr-05 23:20 
GeneralPowerpoint Event Handling using VBA Pin
Mohan vijay20-Apr-05 23:02
Mohan vijay20-Apr-05 23:02 
GeneralRe: Powerpoint Event Handling using VBA Pin
Dave Kreskowiak21-Apr-05 7:48
mveDave Kreskowiak21-Apr-05 7:48 
GeneralRe: Powerpoint Event Handling using VBA Pin
Mohan vijay22-Apr-05 6:19
Mohan vijay22-Apr-05 6:19 
GeneralRe: Powerpoint Event Handling using VBA Pin
Dave Kreskowiak23-Apr-05 2:48
mveDave Kreskowiak23-Apr-05 2:48 
GeneralRe: Powerpoint Event Handling using VBA Pin
Mohan vijay25-Apr-05 2:35
Mohan vijay25-Apr-05 2:35 
GeneralFind the subfolder of the Outlook calendar Pin
M.Ilangovan20-Apr-05 22:16
M.Ilangovan20-Apr-05 22:16 
GeneralPicture box image brightness, contrast, saturation adjustments Pin
Member 176653520-Apr-05 21:15
Member 176653520-Apr-05 21:15 
GeneralAlgorithm Pin
Jaymahinda20-Apr-05 19:17
Jaymahinda20-Apr-05 19:17 
GeneralRe: Algorithm Pin
Christian Graus20-Apr-05 20:21
protectorChristian Graus20-Apr-05 20:21 
GeneralRe: Algorithm Pin
Anonymous21-Apr-05 6:54
Anonymous21-Apr-05 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.