473,772 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

176 New Member
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 8012
ADezii
8,834 Recognized Expert Expert
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 New Member
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,573 Recognized Expert Moderator MVP
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
renatobarcellos
1 New Member
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 Recognized Expert Specialist
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 Recognized Expert Moderator Expert
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 Recognized Expert Moderator Expert
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
2464
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 Javascript, so I'm not really sure what needs to be removed and kept. I was trying the basic search/replaces, but always ended up with Javascript errors.
3
37873
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 needs to be invoked on check/ uncheck). W3C Recomendation: 18 Scripts onselect = script The onselect event occurs when a user selects some text in a text field. This attribute may be used with the INPUT
3
2470
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 system.windows.forms.dll Additional information: Object reference not set to an instance of an object." I receive this exception when I use HelpProvider and play a little with the question mark upon different controls.
3
1663
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 clicks "Log Off", or when a cookie expires, I want to Un-Authenticate the user so that he/she cannot back-pedal to a page without having to sign in again.
0
1923
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. This is properly done, but the events which should be triggered with the button.click method are not triggered in Word. I don't understand because it properly works in the 3 others host applications. If someone has an issue, I would be most grateful....
0
2453
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. This is properly done, but the events which should be triggered with the button.click method are not triggered in Word. I don't understand because it properly works in the 3 others host applications. If someone has an issue, I would be most grateful....
16
2117
by: recover | last post by:
#include <string> #include <iostream> using namespace std; class TConst { private: string con; string uncon; public:
4
3819
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? Here is the code behind:
8
3619
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 <br>mais pour avoir des resultats probant il faut pas faire les mariolles, comme le &quot;fondateur&quot; de bvs
19
2235
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? (in conjunction with css, you know, the usual...;) this is what is meant by "modern" javascript?? so how do folks feel about this who think javascript is so evil they disable it from their browsers?? do sites designed with "modern" javascript...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.