05-27-2006, 08:04 AM
Join Date: Feb 2006
Location: Tipperary, Ireland
Problem 'Setting Focus' to WebBrowser
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.
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"
stopStart.Caption = "START"