Click here to Skip to main content
15,917,456 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralWeb Access Failed Error Pin
Hadi Fakhreddine7-Oct-04 20:43
Hadi Fakhreddine7-Oct-04 20:43 
GeneralRe: Web Access Failed Error Pin
Syed Abdul Khader8-Oct-04 1:08
Syed Abdul Khader8-Oct-04 1:08 
GeneralControling the Number of Records On A DataGrid Page Pin
mcupryk7-Oct-04 14:09
mcupryk7-Oct-04 14:09 
GeneralRe: Controling the Number of Records On A DataGrid Page Pin
Gavin Jeffrey7-Oct-04 22:55
Gavin Jeffrey7-Oct-04 22:55 
GeneralRe: Controling the Number of Records On A DataGrid Page Pin
macsgirl8-Oct-04 1:59
macsgirl8-Oct-04 1:59 
GeneralBind the records from the table to a datalist control in c# Pin
mcupryk7-Oct-04 12:49
mcupryk7-Oct-04 12:49 
GeneralRe: Bind the records from the table to a datalist control in c# Pin
Dave Kreskowiak8-Oct-04 3:23
mveDave Kreskowiak8-Oct-04 3:23 
GeneralDo Loop problem with MSAgent Pin
Member 8605507-Oct-04 12:34
Member 8605507-Oct-04 12:34 
I am experimenting with MSAgent. (Text to speech)

What I am trying to accomplish is to let the program run until the Esc key is pressed.

The code below works fine in the Visual Basic 6.0 IDE.
However, if you minimize the IDE or compile, the program still runs but pressing the Esc key does nothing.
It's like the program has lost focus.
It works fine in the IDE with no interuption.

Can someone help with this?

Here is the code:

Option Explicit
Public MyAgent As Object
_________________________________
Private Sub Form_KeyPress(keyascii As Integer)
'KeyPreview on the Forms properties window is set to True.
'Press the Esc key to exit.
If keyascii = 27 Then
Unload Me
End
End If
End Sub
__________________________________
Public Sub Delay(Seconds As Long)
Dim n As Double

n = Timer + Seconds
Do While Timer < n
DoEvents
Loop

End Sub
__________________________________
Private Sub Form_Load()

Dim Ap As String

'Set Application Path
Ap = App.Path
If Right(Ap, 1) <> "\" Then Ap = Ap + "\"

'Load the character
Agent1.Characters.Load "merlin", Ap + "merlin.acs"
Set MyAgent = Agent1.Characters("merlin")

'something wrong here
Dim keyascii As Integer
Do Until keyascii = 27
If keyascii = 27 Then End

MyAgent.Show
MyAgent.MoveTo 250, 325
Delay 2
MyAgent.MoveTo 400, 325
Delay 2
Loop

End Sub
GeneralRe: Do Loop problem with MSAgent Pin
Dave Kreskowiak8-Oct-04 3:17
mveDave Kreskowiak8-Oct-04 3:17 
GeneralRe: Do Loop problem with MSAgent Pin
Member 8605508-Oct-04 4:48
Member 8605508-Oct-04 4:48 
GeneralRe: Do Loop problem with MSAgent Pin
Dave Kreskowiak8-Oct-04 7:15
mveDave Kreskowiak8-Oct-04 7:15 
GeneralRe: Do Loop problem with MSAgent Pin
Member 86055011-Oct-04 6:21
Member 86055011-Oct-04 6:21 
GeneralRe: Do Loop problem with MSAgent Pin
Dave Kreskowiak11-Oct-04 7:47
mveDave Kreskowiak11-Oct-04 7:47 
GeneralRe: Do Loop problem with MSAgent Pin
Member 86055011-Oct-04 8:15
Member 86055011-Oct-04 8:15 
GeneralRe: Do Loop problem with MSAgent Pin
Dave Kreskowiak11-Oct-04 15:21
mveDave Kreskowiak11-Oct-04 15:21 
GeneralPrintPrivew Problem in MDI Form Pin
szaidi7-Oct-04 12:06
szaidi7-Oct-04 12:06 
GeneralRe: PrintPrivew Problem in MDI Form Pin
szaidi8-Oct-04 4:39
szaidi8-Oct-04 4:39 
GeneralRS-232 event Pin
mannett7-Oct-04 8:52
mannett7-Oct-04 8:52 
GeneralRe: RS-232 event Pin
Dave Kreskowiak7-Oct-04 10:11
mveDave Kreskowiak7-Oct-04 10:11 
GeneralFor Next issues Pin
KreativeKai7-Oct-04 7:09
professionalKreativeKai7-Oct-04 7:09 
Generaladd subreport in crystal report Pin
nitin_ion6-Oct-04 21:11
nitin_ion6-Oct-04 21:11 
Generaladd txt file to sql db using vb6.0 Pin
Mohammed Bassam Dab'an6-Oct-04 19:54
sussMohammed Bassam Dab'an6-Oct-04 19:54 
Generaladd text file to sql database, VB6.0 Pin
Mohammad Daba'an6-Oct-04 19:36
Mohammad Daba'an6-Oct-04 19:36 
GeneralRe: add text file to sql database, VB6.0 Pin
Dave Kreskowiak7-Oct-04 0:30
mveDave Kreskowiak7-Oct-04 0:30 
GeneralRe: add text file to sql database, VB6.0 Pin
Mohammad Daba'an7-Oct-04 2:45
Mohammad Daba'an7-Oct-04 2:45 

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.