ҡդӶ ʵŧ 纺촨շ٨絴͵ ᷹ФѺ

͵Դҷҧ Inbox Ѻ

˹ѡ
-
VB 6/VB.Net
ASP/ASP.Net
Ѻ¤
¹ҹ Flash Movie
ռͺش  
 RSS Feeds
 ǹŴ RSS Reader ...   Download  RSS Reader

Forum - www.g2gnet.com
Webmaster - www.g2gnet.com
Visitors - Session views
 5 6 1 6 1 8 5

7 ѹҤ ..2549
142 Users On-Line.
Visitors - Page views
 8 9 7 3 9 2 8
1 Ҿѹ ..2551

Google   
g2gnet.com
Ҵѡ:  

ûءҹ MS Visual Basic 6.0 ѺþѲ͡¹͹

Category »  VB 6/VB.Net
: Webmaster 7/12/2550 15:15:00
(ҹ : 28964) 

ҧͧ鹹 ᷺ͧá (Logic) ÷ѹҡ¤Ѻͧ §ҡʹͧҹẺ CAI (Computer Assisted Instruction) ѡɳТͧͺѺ¹ (Interactive) աٻẺ˹ ҧѧټ͹ پѹ ǤԴ Դçѹ 㹡ùӤҪ»ءҹ㹡¹ ͹Դªҡ áШз繵ҧҧǹҹФѺ ... ͧ 价ҡ ... ѹóẺ´ա м繪شԴѺôҾ 黡ͧ ǹŴͧ ¡еѧ ١ҹͧ蹴١ѹ ... ͹ ... ͧѺ ѧ硡鹤 ҡ鹹ФѺ ͧ͹ йѴ¹Ţŧдɴ ... ... ¹˹ѧ͡ѹ


˹ҵ


úǡŢ

 

ǹŴ Source Code Ѻ MS Visual Basic 6.0 - Service Pack 6
ǹŴشԴ (Arithmetic Software) - Setup Program

Component ͡ҹ ... ǹ͡ Flash Ҫ´¤Ѻ

Ӥѭ㹡úǡŢ
' 㹡Ţ ... ͡ҹѧ蹡¹ʹǹФѺ
' ҡ gRandom.bas
' ҡѧ蹡 ѹջԷҾաҡ Randomize ԴҡѺ Visual Basic Ѻͧ ...
Sub RandomNumber()
Dim MaxNumber As Integer
    ' ͡ӹǹѡͧ
    Select Case Digit
        Case 1:
            MaxNumber = 9
            lblCarry.Visible = False
        Case 2:
            MaxNumber = 99
            lblCarry.Visible = True
        Case 3:
            MaxNumber = 999
            lblCarry.Visible = True
        Case 4:
            MaxNumber = 9999
            lblCarry.Visible = True
    End Select
    
    ' ѹҡ͹ ... ФѭФѺǹ
    RandShuffle Date$ + Time$ + Str$(Timer)
    
    ' 觤ҵش   ٧شѧѧŢӹǹ
    lblSetNumber.Caption = RandInteger(1, MaxNumber)
    lblOperand.Caption = RandInteger(1, MaxNumber)
    
End Sub

' õǨӵͺ
Private Sub cmdAnswer_Click()
Dim i As Byte
Dim Result As Integer
    ' ҡѧդӵͺ͡ҡ Ѻ Focus ѧ Control ѧͺ
    For i = 0 To Digit - 1
        If Trim(txtAnswer(i).Text) = "" Or Len(Trim(txtAnswer(i).Text)) = 0 Then
            MsgBox "ͧͧ͡Ţ㹪ͧ " & i + 1 & " ͹¹Ф.", vbOKOnly + vbExclamation, "§ҹʶҹ"
            txtAnswer(i).SetFocus
            Exit Sub
        End If
    Next
    ' ùӵѡ (Character) §ѹ仴ͧ +
    ' ҡŧٻẺͧŢ (Number)
    Select Case Digit
        Case 1:
            Result = Val(txtAnswer(1).Text + txtAnswer(0).Text)
        Case 2:
            Result = Val(txtAnswer(2).Text + txtAnswer(1).Text + txtAnswer(0).Text)
        Case 3:
            Result = Val(txtAnswer(3).Text + txtAnswer(2).Text + txtAnswer(1).Text + txtAnswer(0).Text)
        Case 4:
            Result = Val(txtAnswer(4).Text + txtAnswer(3).Text + txtAnswer(2).Text + txtAnswer(1).Text + txtAnswer(0).Text)
    End Select
    ' ١ͧ
    ' ҡ Ӥ Label Control ͧǵ駡ѺǺǡѹ ººѺ TextBox Control 硵ͺŧ
    If (Val(lblSetNumber.Caption) + Val(lblOperand.Caption)) = Result Then
        'MsgBox "觨ѧ¤ ... ˹ٷ١ͧǤ.", vbOKOnly + vbInformation, "§ҹʶҹ"
        
        ' ҹ Shockwave Flash ...
        ' ͧͧѹաʴš Flash (㹺ͧ)
        ' ҧç٧  ѧѺ硼¹¹ФѺ
        ' §ͧԹ §ͧͧѺ ... 
        ' ҧ Acoustica Ѻ GoldWave Ҫ ... ͡˹ҡзӡҸѧաչ֧Ѻ
        Flash.Playing = True
        Flash.Movie = App.Path & "\Right.swf"
        Right = Right + 1
    ' ӼԴ
    Else
        'MsgBox "˹ٷ١Ф ... ¤.", vbOKOnly + vbExclamation, "§ҹʶҹ"
        Flash.Playing = True
        Flash.Movie = App.Path & "\Wrong.swf"
        Wrong = Wrong + 1
    End If
    
    ' 鹵⨷
    Call SetupScreen
    Call RandomNumber
    txtAnswer(0).SetFocus
End Sub

Ӥѭ㹡źŢ
Sub RandomNumber()
Dim Temp As Integer
Dim MaxNumber As Integer
    Select Case Digit
        Case 1:
            MaxNumber = 9
            lblCarry.Visible = False
        Case 2:
            MaxNumber = 99
            lblCarry.Visible = True
        Case 3:
            MaxNumber = 999
            lblCarry.Visible = True
        Case 4:
            MaxNumber = 9999
            lblCarry.Visible = True
    End Select
    
    ' ѹҡ͹
    RandShuffle Date$ + Time$ + Str$(Timer)
    
    ' 觤ҵش   ٧شѧѧŢӹǹ
    lblSetNumber.Caption = RandInteger(1, MaxNumber)
    lblOperand.Caption = RandInteger(1, MaxNumber)
    
    ' *** ෤ԤͧѺ  Swap ***
    ' Ǩͺҵǵդҹ¡ ǡз
    ' ҡӡѺ¹ (SWAP) ҷ駤Сͧ ...
    ' ͧǵդҹ¡ҵźͧ
    ' ѧ Ҩ֧ͧ价ӡФѺ ... ͧ
    If Val(lblSetNumber.Caption) < Val(lblOperand.Caption) Then
        Temp = lblOperand.Caption
        lblOperand.Caption = lblSetNumber.Caption
        lblSetNumber.Caption = Temp
    End If
End Sub

:
' ͧѺ ... ͧҡ MDI Form 觷ͧúǡźöӡûԴ˹Ҩ
' ҡͧӡ÷ͺҢͧ÷ 3 ҧҹҧ  Comment ѹ Ѻ
'  Comment  Form_Unload Ǿͧͧ٫ԤѺҨԴâ ?????
Private Sub Form_Load()
    ' ͧ˹ Ѻ óշŴء
    '  Comment  ͧѧࡵ˵ءó Form_Unload 
    '  Form_Unload  Set frmSubtract = Nothing  ҡ鴵ǹ ( ' Comment ѹ)
    ' 㹵èѧ ... ͧ蹴ԴѺ ... ͧ
    'Right = 0
    'Wrong = 0
    'Total = 0
    
    ' ͡ӹǹѡ͹ ... ҡ optDigit_Click зӡ˹Ҩͧ
    Call optDigit_Click(0)
    Call RandomNumber
End Sub

Private Sub Form_Unload(Cancel As Integer)
    'Set frmAdd = Nothing
End Sub

ҧáѹҧФѺ ... зѴѴẺ öһءҹѺк¹͹բҴ˹ ͡˹Ҽйʹ Visual Basic 6.0 Ѻ Flash óẺ觢仡ҹ ... ôԴѹ㹵͹ ... ҵ价प


͵ - g2gNet Dot Com
Ţ¹ҳԪ硷͹ԡ 0407314800231
CopyLeft © 2004 - 2099 g2gNet.Com All rights reserved.
Email: [email protected] . 08-6862-6560