main form / sub form concept (again)

D

Dirk Schwidde

hi,

I'd like to have subforms to popup when I hover over "hot spots"
of the main form. The subforms should close automatically after a
small period of time.

Now, this is the concept so far:

in the main form:

Private Sub image_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
subform.Show vbModeless
End Sub

in the subform:

Private Sub UserForm_Activate()
Application.Wait Now + TimeSerial(0, 0, 1)
Unload Me
End Sub

It works, but if I move the mouse between those "hot spots" too fast,
the programm crashes giving the message
"method wait for object _application failed"

Wthat's the problem and how can I solve it?

Is there a way to let the subforms close when the mouse pointer
is no longer over the appropriate hot spot?

Regards
Dirk
 
A

Alan

hi,

I'd like to have subforms to popup when I hover over "hot spots"
of the main form. The subforms  should close automatically after a
small period of time.

Now, this is the concept so far:

in the main form:

Private Sub image_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
    subform.Show vbModeless
End Sub

in the subform:

Private Sub UserForm_Activate()
    Application.Wait Now + TimeSerial(0, 0, 1)
    Unload Me
End Sub

It works, but if I move the mouse between those "hot spots" too fast,
the programm crashes giving the message
"method wait for object _application failed"

Wthat's the problem and how can I solve it?

Is there a way to let the subforms close when the mouse pointer
is no longer over the appropriate hot spot?

Regards
Dirk

Just a thought because I have not tried it, but can you not use the
error handler to stop this crashing?

On Error ....
 
J

Jim Cone

An alternative is to use the ControlTipText property of your controls
and/or add small blank (no border, no interior, no caption) labels to the
hot spots and use their ControlTipText property.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)




"Dirk Schwidde"
 
D

Dirk Schwidde

An alternative is to use the ControlTipText property of your controls
and/or add small blank (no border, no interior, no caption) labels to the
hot spots and use their ControlTipText property.

thanks, but that way I'd be limited to showing text.


Dirk
 
J

Jim Cone

Well, I guess that means you are displaying a picture.
Another alternative then is to use the ImageList control (from additional controls).
You can load it with multiple images and then display any single image by calling its index number.
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Extras for Excel add-in: convenience built-in)




"Dirk Schwidde" <[email protected]>
wrote in message
 
D

Dirk Schwidde

Well, I guess that means you are displaying a picture.
pictures, text - whatever one can place on a form

however, I took your idea regaring tooltips and
changed it like this:

I put two image object, a larger one and smaller one,
on top of each other so that I have an inner section
and an outer section of every "hot spot".

The mouseover event of the immer section
(i. e. the smaller image object) opens the subform
and the mouseover event of the outer section
(i. e. the larger image object) unloads it.

Works great!

There's only one drawback: The outer section really
is too large as all objects have to be aligned to that
generic grid of every form

Is there a way around that (like pressing and holding "alt"
in word 2003 to be able to resize pictures in very small units)?


Regards
Dirk
 
J

Jim Cone

Under the VBE menu... Tools | Options | General (tab)
There is a checkbox... "Align Controls to Grid"
Removing the checkmark "may" do what you want.
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Formats & Styles: lists/removes unused styles & number formats - in the free folder)
 
D

Dirk Schwidde

Under the VBE menu... Tools | Options | General (tab)
There is a checkbox... "Align Controls to Grid"
Removing the checkmark "may" do what you want.

it does!

thanks
dirk
 

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