Listbox.hWnd ?

G

Gijs Beukenoot

Hi all,

Trying to implement the fancy tooltips from Stephen Leban's site, I ran
into a little problem...
Basically, it's due to the fact that the Access listbox control doesn't
have their own windowhandle exposed so Stephens code uses a couple of
lines of code to find all listboxes and, based on their placement,
retreives the windowhandle. Works good in not too complicated forms.

However, I have a form with a tabcontrol and 3 (or more) tabs and on
each tab is a listbox in exactly the same place. In this case, Stephens
code always finds the same listbox...

I've been puzzeling on this for a couple of hours but so far I haven't
been able to get a solution besides re-designing my forms (moving the
listboxes to other positions or even to subforms and see if that makes
a difference) or just not using it at all.

I might be able to make the listboxes very small in the load-event and
then resize them after implementing the tooltip but I wonder if anyone
has ran into the same problem and perhaps even found a solution for it.

Thanks in advance,

GB
 
S

Stephen Lebans

Another user had this same exact issue. I can't remember how we finally
resolved it. If you look at the ListBox's hWnd Window structure, you will
see that in your case, three windows of identical size and position would
exist. How can you differentitate between them? If they were standard
ListBox window classes then we could simply interrogate each control and
distiguish them via their contents.
Nothing comes to mind off the top of my head. It really bothers me that I
cannot remember the solution for the other user with the identical issue.

Let's check my archived Email.......

Here's one but I thought I had come up with something else simpler.

The only way around the problem for TAB controls is to follow the same logic
that Access uses. On the Change event for the Tab control, delete all of the
Tooltips belonging to any controls on the TAB control and then reset them
for the Current Tab Page.


-

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

Gijs Beukenoot

From Stephen Lebans :
Another user had this same exact issue. I can't remember how we finally
resolved it. If you look at the ListBox's hWnd Window structure, you will see
that in your case, three windows of identical size and position would exist.
How can you differentitate between them? If they were standard ListBox window
classes then we could simply interrogate each control and distiguish them via
their contents.
Nothing comes to mind off the top of my head. It really bothers me that I
cannot remember the solution for the other user with the identical issue.

Let's check my archived Email.......

Here's one but I thought I had come up with something else simpler.

The only way around the problem for TAB controls is to follow the same logic
that Access uses. On the Change event for the Tab control, delete all of the
Tooltips belonging to any controls on the TAB control and then reset them for
the Current Tab Page.


-

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks

Thanks Stephen for your quick reply.

I might try the suggestion you give but for the moment I'll just don't
'tooltip' the listboxes. I'll give this some thoughts and come back to
this later because I have to finish some things first.

GB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top