Ken Ismert
KIsmert at TexasSystems.com
Wed Sep 15 12:36:49 CDT 2004
Francisco, General approach: In an Access form, I have found no simple way to determine when the mouse has moved off of a control. The idea then, is to trap MouseMove events for all controls and sections. When a control that you don't want to animate receives a MouseMove, it must tell all controls that you are animating to turn off their backcolor. A few quick thoughts: * No need for the hidden box - just use the label's own BackColor property * You will need perhaps three objects: 1. MouseOn object - sinks MouseMove event for Labels, TextBoxes, etc. Has two functions. First, when it receives a MouseMove event, it changes the control's BackColor 'on' if it is 'off', and notifies the MouseManager to turn 'off' all other controls. Second, turns 'off' its backcolor when requested by MouseManager. 2. MouseOff object - sinks MouseMove events for Sections, Labels, TextBoxes, etc. Includes all controls on the form that you don't want to animate. Has one function: when it receives a MouseMove event, it notifies the MouseManager to turn 'off' all other controls 3. MouseManager object - maintains two collections: a MouseOn object collection, and a MouseOff object collection. Has methods for adding a MouseOn and a MouseOff object to each collection. Has a method which loops through all MouseOn objects, telling them to turn their backcolors off, except for the active one, if any. It also has a Destruct method which sets both collections to nothing. * When loading, the form then must create the MouseManager object, and tell it to add all controls to either the MouseOn or MouseOff collections. When unloading, the form must destroy the MouseManager object. Finally, you may end up disappointed with the quality of the animation you get after all this effort. It is possible to move the mouse fast enough that none of the controls get a MouseMove event, leaving one of the controls highlighted, even though your cursor is off the form. -Ken -----Original Message----- From: fhtapia at gmail.com [mailto:fhtapia at gmail.com] Sent: Wednesday, September 15, 2004 10:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] Objects.... So I have a label class that has a function to turn the mouse icon to a hand so users know it's a clickable item. I'd like to duplicate a MouseOver event, so for that I'm going to place a hidden box under the labels so when the mouse wanders off, I can change the color off again... I'd like to wrap the box into a class, but I'm having difficulty envisioning how I'd call all the label class objects to change back to the default color. help tips and hints appreciated... doc, url links are appreciated even more :D btw, new version of firefox is out for those that don't know... this is version 1.0 very very nice :) -- -Francisco "Rediscover the web" http://www.mozilla.org/products/firefox/ ttp://spreadfirefox.com/community/?q=affiliates&id=792&t=86