473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to create a "un- On Mouse Move" event?

176 100+
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 :)
Dec 31 '06 #1
7 7944
ADezii
8,834 Expert 8TB
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:
Expand|Select|Wrap|Line Numbers
  1. SendKeys "{TAB}", True
This seems to work and will eliminate the White bordering area and
Blinking Cursor
Dec 31 '06 #2
Michael R
176 100+
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:
Expand|Select|Wrap|Line Numbers
  1. SendKeys "{TAB}", True
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!
Dec 31 '06 #3
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 :)
Dec 31 '06 #4
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.
Apr 15 '14 #5
Seth Schrock
2,965 Expert 2GB
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.
Apr 15 '14 #6
zmbd
5,501 Expert Mod 4TB
so something like this?

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Sub Command12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  5.    Me.Command12.Caption = "MouseON"
  6. End Sub
  7.  
  8. Private Sub FormHeader_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  9.     Me.Command12.Caption = "MouseOFF"
  10. End Sub
  11.  
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.
Apr 15 '14 #7
zmbd
5,501 Expert Mod 4TB
ah, simple fix:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private zmousein As Boolean
  5.  
  6. Private Sub Command12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  7.     If Not zmousein Then
  8.         Me.Command12.Caption = "MouseON"
  9.         zmousein = True
  10.     End If
  11.  
  12. End Sub
  13.  
  14. Private Sub FormHeader_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  15.     If zmousein Then
  16.         Me.Command12.Caption = "MouseOFF"
  17.         zmousein = False
  18.     End If
  19. End Sub
  20.  
Apr 15 '14 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
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...
3
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...
3
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...
3
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...
0
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....
0
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....
16
by: recover | last post by:
#include <string> #include <iostream> using namespace std; class TConst { private: string con; string uncon; public:
4
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?...
8
by: Ulysse | last post by:
Hello, I need to clean the string like this : string = """ bonne mentalit&eacute; mec!:) \n <br>bon pour info moi je suis un serial posteur arceleur dictateur ^^* \n ...
19
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? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
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
0
BarryA
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.