It's an interesting question, as I see it.
I have a form, in which there are a few command buttons, which change color when the mouse is on top of them (On Mouse Move). Now, I want the color to be changed back to normal when the mouse moves away from the command's button area. The only way I have figured up untill now how of to do it, is having a big text box around the command buttons area, which is sent to back, and to have On Mouse Move event on it too. Problem is, that the text box has to be visible in order for this to work, and so if a user will accidently click on the text box area, it will become white - editing mode, and will conceal the command buttons, plus the curson blinker will apear, which is not asthethic.
Any creative thought on how to make this work?
Thanks :)
7 7944
It's an interesting question, as I see it.
I have a form, in which there are a few command buttons, which change color when the mouse is on top of them (On Mouse Move). Now, I want the color to be changed back to normal when the mouse moves away from the command's button area. The only way I have figured up untill now how of to do it, is having a big text box around the command buttons area, which is sent to back, and to have On Mouse Move event on it too. Problem is, that the text box has to be visible in order for this to work, and so if a user will accidently click on the text box area, it will become white - editing mode, and will conceal the command buttons, plus the curson blinker will apear, which is not asthethic.
Any creative thought on how to make this work?
Thanks :)
1) Make sure the Back Style property of the Text Boxes are Transparent
2) Set the Visible property of the Text Boxes to Yes
3) For the Text Box, Format ==> Send to Back
4) Reset the Fore Color property to the Default in the MouseMove() Event of
the Text Box
5) In the MouseDown() Event of the Text Boxes place this line of code:
This seems to work and will eliminate the White bordering area and
Blinking Cursor
1) Make sure the Back Style property of the Text Boxes are Transparent
2) Set the Visible property of the Text Boxes to Yes
3) For the Text Box, Format ==> Send to Back
4) Reset the Fore Color property to the Default in the MouseMove() Event of
the Text Box
5) In the MouseDown() Event of the Text Boxes place this line of code:
This seems to work and will eliminate the White bordering area and
Blinking Cursor
Nice indeed.
It works, although the white bordering area still binks for an instance.
Happy New Year!
NeoPa 32,556
Expert Mod 16PB
Would it help to use a Label control in place of the TextBox.
This would have the benefit of being unable to receive the focus.
Nice thinking btw :)
I'm sorry to answer on such an old post but since I found a much easier approach, I decided to share...
You can set an "On Mouse Move" event for the Detail section of the form. You would reset all buttons to the normal state there and would not need to create many different objects behind your buttons.
Current versions of Access have a Hover Color property that does this automatically so there is no need to code it yourself. There is also the Pressed Color, Hover Fore Color and Pressed Fore color properties to allow for full color change settings without a single line of code. I had assumed that this was available for a long time, but I know it has been available since 2007.
zmbd 5,501
Expert Mod 4TB
so something like this? -
Option Compare Database
-
Option Explicit
-
-
Private Sub Command12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Me.Command12.Caption = "MouseON"
-
End Sub
-
-
Private Sub FormHeader_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Me.Command12.Caption = "MouseOFF"
-
End Sub
-
I used the header because I have a command button there and it was easy.
What I see happening though is a flicker in the command button with the mouse movement which is sort of distracting.
zmbd 5,501
Expert Mod 4TB
ah, simple fix: - Option Compare Database
-
Option Explicit
-
-
Private zmousein As Boolean
-
-
Private Sub Command12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
If Not zmousein Then
-
Me.Command12.Caption = "MouseON"
-
zmousein = True
-
End If
-
-
End Sub
-
-
Private Sub FormHeader_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
If zmousein Then
-
Me.Command12.Caption = "MouseOFF"
-
zmousein = False
-
End If
-
End Sub
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: fartsniff |
last post by:
Hello all.
Can someone help out ? I found this PHP code that works just fine, however,
I am trying to put it back into its original Javascript form.
I am still learning the syntax, etc. for...
|
by: F. Da Costa |
last post by:
Hi,
Does the following indeed imply that this event is NOT called when an <input type="checkbox" is toggled?
This would thus imply the usage of the onClick handler instead (assuming an action...
|
by: cristiank |
last post by:
hi everybody,
I need to clear something out,
does anybody have ever encountered such an exception until now :
"Un unhandled exception of type System.NullReferenceException occurred in...
|
by: mike |
last post by:
Hello.
I have a web site that is using Basic Authentication (yes, I am using HTTPS)
and is sessionless (I am maintaining session state in a database via a
custom component).
When the user...
|
by: maitrepoy |
last post by:
Hello
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003.
This addin consists in adding 2 new Buttons in the "File" Menu of office....
|
by: maitrepoy |
last post by:
hello
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003.
This addin consists in adding 2 new Buttons in the "File" Menu of office....
|
by: recover |
last post by:
#include <string>
#include <iostream>
using namespace std;
class TConst
{
private:
string con;
string uncon;
public:
|
by: Greg |
last post by:
I've searched everywhere for a solution
Microsoft .NET Framework V 2.0.50727
AutoEventWireup="false"
image2.aspx resize an image on the fly but Page_Load is triggered
twice:
Any suggestion?...
|
by: Ulysse |
last post by:
Hello,
I need to clean the string like this :
string =
"""
bonne mentalité mec!:) \n <br>bon pour
info moi je suis un serial posteur arceleur dictateur ^^*
\n ...
|
by: maya |
last post by:
hi,
so what is "modern" javascript?? the same as "DOM-scripting"? i.e.,
editing content (or changing appearance of content) dynamically by
massaging javascript objects, html elements, etc? ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |