Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Focus Issues with Web Browser Control
Message
From
28/01/2017 14:04:06
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01647091
Message ID:
01647095
Views:
59
*yes verified ,its occurs (my Adobe Reader XI)
*the textbox have initially the focus (cursor)
*when the pdf is loaded the textbox focus go away (even if you force it in code in form.init!)
*i dont know if this a new surprise (there is many) !
*the solution is to add a timer to the form just to make the focus and disable it.
*the code below can try the bug (_screen.yvar=.f.) and the correction (_screen.yvar=.t.)
*
_Screen.AddProperty("yvar",.f.)  &&try with .f. and .t. to see the difrence

Publi oform
oform=Newobject("asup")
oform.Show
Read Events
Retu
*
Define Class asup As Form
	Top = 0
	Left = 0
	ShowWindow=0
	Height = 398
	Width = 552
	AutoCenter=.T.
	Caption="Focus problem when navigating to PDf file"
	Name = "Form1"

	Add Object text1 As TextBox With ;
		Anchor = 768, ;
		Alignment = 3, ;
		Value = "AZERTY", ;
		Height = 23, ;
		Left = 72, ;
		Top = 12, ;
		Width = 156, ;
		Name = "Text1"

	Add Object olecontrol1 As OleControl With ;
		oleclass="Shell.explorer.2", ;
		Top = 48, ;
		Left = -2, ;
		Height = 349, ;
		Width = 553, ;
		Anchor = 15, ;
		Name = "Olecontrol1"

	Add Object timer1 As Timer With ;
		Top = 12, ;
		Left = 240, ;
		Height = 23, ;
		Width = 23, ;
		Enabled = .F., ;
		Interval = 1000, ;
		Name = "Timer1"

	Procedure Init
		Thisform.timer1.Enabled=_Screen.yvar
	Endproc

	Procedure olecontrol1.Init
		With This
			.silent=.T.
			.Navigate(Getfile('pdf'))
			Inkey(3)  &&transitionnings
		Endwith
	Endproc

	Procedure timer1.Timer
		Thisform.text1.SetFocus
		This.Enabled=.F.
	Endproc

	Procedure Destroy
		_Screen.yvar=Null
		oform=Null
		Clea Events
	Endproc

Enddefine
*
*-- EndDefine: asup
*
Previous
Reply
Map
View

Click here to load this message in the networking platform