VFP VCL CLASS Container

Discussions about document viewing.
Post Reply
mks1970
Posts: 2
Joined: Fri Aug 15, 2008 7:15 pm

VFP VCL CLASS Container

Post by mks1970 » Fri Aug 15, 2008 7:35 pm

pl: VFP 8.0 SP1

Hello !

I've a little problem.
I try to create a new class - e.g. myViewer based on a container and add GdViewer as object in it.

The problem is- if i placed it on an Form and run the objekt (Container) is visible but not GdViewer ???

TestForm.oImage.oGdViewer.Visible = .F.
TestForm.oImage.oGdViewer.Visible = .T.

GdViewer is shown, otherwise i click in the object (Container) the GdViewer object also shown

I've try to set Visible off/on in the Init-Event from the Container oder GdViewer but nothing helps ...
No GdViewer-method helps (e.g. displayfromfile or refresh)
i hope, anybody can help me - please - this time must be ... ;-)

mike (germany, sorry for the verry bad english)

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: VFP VCL CLASS Container

Post by Loïc » Fri Aug 15, 2008 7:55 pm

Hi,

This is a focus problem from vfp.

Into the init method of your class based on a container add this line:

Code: Select all

this.olecontrol1.SetFocus()
OleControl1 is the name of the GdViewer object.


Also, I suggest you to add this line too:

Code: Select all

application.AutoYield = .F. 
Best regards,

Loïc

mks1970
Posts: 2
Joined: Fri Aug 15, 2008 7:15 pm

Re: VFP VCL CLASS Container

Post by mks1970 » Sat Aug 16, 2008 5:56 pm

Merci Loïc,

for the very fast help !

Your solution works, but i will not manipulate the focus ...

so i had found an other way to fix the problem:

'Container'.Refresh:

if This.pFirstInit
xVisible = This.oGdViewer.Visible
This.oGdViewer.Visible = .f.
This.oGdViewer.Visible = .t.
This.oGdViewer.Visible = xVisible
This.pFirstInit = .f.
endif

thanks and a nice weekend

Mike

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest