
05-27-2006, 08:04 AM
|
|
Newcomer
|
|
Join Date: Feb 2006
Location: Tipperary, Ireland
Posts: 8
|
|
Problem 'Setting Focus' to WebBrowser
|
Hey everyone,
My problem would appear to be a simple one but it is one I cannot seem to remedy.
I have a FORM which contains 2 COMMAND BUTTONS and a WEB BROWSER, in which a basic computer game is displayed.
In order to start the process which, controls the computer game, the user must press the start button, however this then Sets the focus on the Start Button which, means the focus is taken off the Web Browser and therefore the desired action does not take place in the game.
I’ve tried setting the focus to the Web Browser as shown in the code segment below but this doesn't seem to work.
Any help or advice would be much appreciated.
Thanking you in advance.
Code:
Private Sub START_Click()
dirpath = "C:\LOCATION\ioFiles\"
SlowerFaster.Caption = ""
AmpFeedback.Caption = ""
stopStart.FontSize = 18
stopStart.FontBold = True
glo.TaskID = Shell("C:\Blank\getsamples.exe", vbMinimizedNoFocus) 'Start "getsamples.exe"
Sleep 100
WebBrowser1.SetFocus
Sleep 100
stopStart.Caption = "START"
DoEvents
|
__________________
Emmetts
|