Help sensei Lebans!

  • Thread starter Thread starter TC
  • Start date Start date
T

TC

Hi Stephen

Hoping you will read this & be able to comment.

I need to get, at runtime, the absolute location (in screen pixels) of
a control on a form. This is for an online tutorial program, that
actually points to various controls & tells the user what they do. I've
got this working fine, using code that I've lifted from your excellent
PositionFormRelativeToControl function.

I now need, if possible, to do the same for reports. That is: to get,
at runtime, the absolute location (in screen pixels) of a control on a
report; bearing in mind that the report might be displayed initially in
any size.

For the sake of this exercise, reports & forms seem rather similar.
Both use lightweight controls; both have the necessary control
properties (left, top etc.); and both have 3 OFormSubs(!) But on an
initial try, I did not get the right result.

So, before I start delving in to this: do you happen to know, off the
top of your head, whether it is possible?

TIA,
TC
 
It's certainly possible but would be quite complex.

For a Report in Print Preview there is only a single window. Unlike a
Form, each report sections(OFormSub) hWnd is not valid. I think you
would have to log the position/dimensions of each section and control
during the relevant print events. THere is code to do this on my site,
in the JustiDirect project.

You would then have to convert these coordinates/dimensions to the
actual Print Preview window depending on the current Zoom level, Screen
DPI and perhaps the selected printer drivers output DPI setting.

I'm sure it could be done but would require a significant investment in
programming time.

Let me know what you decide.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Ok, thanks for your comments.

The idea I am working on, is a generic "drop in" Tutorial module for
any Access system. One thing that this module must do, is to hilite
selected controls by outlining them, or pointing to them. I've got this
working fine for forms, but I have not touched reports. One design
requirement is, /no code changes/ to the target system.

I've taken what you say, on board. I'll see if I can inject some events
at runtime - thereby meeting the "no [source] code changes"
requirement! But it does sound like it will be too much work for the
benefit. Particularly since the user is very likely to scroll reports
around the screen - unlike forms, which tend to stay in their original
place.

Thanks again for your feedback,
TC
 
in message:
Ok, thanks for your comments.

The idea I am working on, is a generic "drop in" Tutorial module for
any Access system. One thing that this module must do, is to hilite
selected controls by outlining them, or pointing to them. I've got this
working fine for forms, but I have not touched reports. One design
requirement is, /no code changes/ to the target system.

TC,

So are you saying this Tutorial module could be used with any Access
database as a way for a developer to create a sophisticated Help
system? A way to train new users to a system and/or a way to
demonstrate an application to a prospective client?

Sounds cool!
 
Yes, exactly. There is a limited number of things that you want to do
in a tutorial. (Display a message. Move the cursor. Wait for the /user/
to move the cursor, click a button, enter some data, & so on.) I've
created a generic module which lets you put those things together with
arbitrary sequence & complexity. It works very well, so far!

Cheers,
TC
 
in message:
Yes, exactly. There is a limited number of things that you want to do
in a tutorial. (Display a message. Move the cursor. Wait for the /user/
to move the cursor, click a button, enter some data, & so on.) I've
created a generic module which lets you put those things together with
arbitrary sequence & complexity. It works very well, so far!

Sounds great TC, very interesting!
Best of luck in completing the project.
 
Back
Top