Click here to Skip to main content
16,005,206 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questiondatabase programming Pin
ramin_ok13-Jul-06 0:38
ramin_ok13-Jul-06 0:38 
AnswerRe: database programming Pin
Christian Graus13-Jul-06 4:26
protectorChristian Graus13-Jul-06 4:26 
QuestionHow I do Video Streaming in VB.NET Pin
sam_pune12-Jul-06 23:42
sam_pune12-Jul-06 23:42 
AnswerRe: How I do Video Streaming in VB.NET Pin
Dave Kreskowiak13-Jul-06 4:40
mveDave Kreskowiak13-Jul-06 4:40 
Questionusing VB 6.0 how to reset the timer while excuting the program Pin
Simple programmer12-Jul-06 23:14
Simple programmer12-Jul-06 23:14 
AnswerRe: using VB 6.0 how to reset the timer while excuting the program Pin
Dave Kreskowiak13-Jul-06 4:31
mveDave Kreskowiak13-Jul-06 4:31 
GeneralRe: using VB 6.0 how to reset the timer while excuting the program Pin
Simple programmer13-Jul-06 15:44
Simple programmer13-Jul-06 15:44 
GeneralRe: using VB 6.0 how to reset the timer while excuting the program Pin
Dave Kreskowiak14-Jul-06 0:41
mveDave Kreskowiak14-Jul-06 0:41 
I'm afraid you'll have to scrap ALL of this code. It won't work with a timer at all.

You have to store all of the paths to these images in an array. You'll also have to store the correct answer in that array. You'll proably need a class-level variable to store the current index that's being shown in that array. Then you can setup a timer. Maybe something like this:
Do NOT copy and paste this "code"!!
Public Class Form1

    Private currentIndex As Integer
    Private flashCards(4,1) As String

    Private Sub Form1_Load()
        ' The first dimension is the filename of the question picture,
        ' The second dimension is the correct answer for that question.
        flashCards(0,0) = "C:\images\apple"
        flashCards(0,1) = "A"
        flashCards(1,0) = "..."
        flashCards(1,1) = "B"
        flashCards(2,0) = "..."
        flashCards(2,1) = "A"
        flashCards(3,0) = "..."
        flashCards(3,1) = "C"

        ' Set the current question number to 0.
        currentIndex = 0
        
        ' Show the first question...
        UpdateQuestionImage()
    End Sub

    Private Sub Form1_KeyPress(key As Integer)
        If Str(key) = flashCards(currentIndex, 1) Then
            ' The correct answer was found!
            currentIndex = currentIndex + 1
            UpdateQuestionImage()
        End If
    End Sub

    Private Sub UpdateQuestionImage()
        Timer1.Enabled = False
        image1.picture=Loadpicture( flashCards(currentIndex, 0) ) 
        Timer1.Interval = 10000
        Timer1.Enable = True
    End Sub

    Private Sub Timer1_Timer()
        ' Question was not answered in time!
        currentIndex = currentIndex + 1
        UpdateQuestionImage()
    End Sub


Dave Kreskowiak
Microsoft MVP - Visual Basic

QuestionIn crystal report data are not displayed when passing paramete Pin
subhsam12-Jul-06 23:14
subhsam12-Jul-06 23:14 
Questionconnecting to MySQL Server Pin
70's live!12-Jul-06 22:07
70's live!12-Jul-06 22:07 
AnswerRe: connecting to MySQL Server Pin
Guffa13-Jul-06 0:59
Guffa13-Jul-06 0:59 
AnswerRe: connecting to MySQL Server Pin
Guffa13-Jul-06 11:50
Guffa13-Jul-06 11:50 
GeneralRe: connecting to MySQL Server Pin
70's live!16-Jul-06 20:40
70's live!16-Jul-06 20:40 
QuestionI need help...pls help.... Pin
LifeIsSad12-Jul-06 22:02
LifeIsSad12-Jul-06 22:02 
AnswerRe: I need help...pls help.... Pin
Dave Kreskowiak13-Jul-06 2:36
mveDave Kreskowiak13-Jul-06 2:36 
AnswerRe: I need help...pls help.... Pin
PlayByTheRules13-Jul-06 2:37
PlayByTheRules13-Jul-06 2:37 
AnswerRe: I need help...pls help.... Pin
Christian Graus13-Jul-06 4:27
protectorChristian Graus13-Jul-06 4:27 
QuestionTreeView Multi-select Pin
jo_eylee12-Jul-06 21:53
jo_eylee12-Jul-06 21:53 
AnswerRe: TreeView Multi-select Pin
Dave Kreskowiak13-Jul-06 2:39
mveDave Kreskowiak13-Jul-06 2:39 
AnswerRe: TreeView Multi-select Pin
Werries18-Jul-06 11:21
Werries18-Jul-06 11:21 
GeneralRe: TreeView Multi-select Pin
jo_eylee18-Jul-06 17:28
jo_eylee18-Jul-06 17:28 
QuestionADVAPI32.lib Pin
vbvic12-Jul-06 20:38
vbvic12-Jul-06 20:38 
AnswerRe: ADVAPI32.lib Pin
Dave Kreskowiak13-Jul-06 2:38
mveDave Kreskowiak13-Jul-06 2:38 
QuestionHow to dynamically create a query in Access database using Vb.net/C# and ADO.Net Pin
Hari Prasad Karnam12-Jul-06 20:33
Hari Prasad Karnam12-Jul-06 20:33 
AnswerRe: How to dynamically create a query in Access database using Vb.net/C# and ADO.Net Pin
George B Gilbert13-Jul-06 15:57
George B Gilbert13-Jul-06 15:57 

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.