473,804 Members | 3,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Buttons still appear "highlighte d" after being clicked

12 New Member
I have a form which contains some buttons. The buttons use some of the standard images that come with access 2003 (e.g., the move next record image, or the sort ascending/descending images). The default behavior for access is to give the button a "highlighte d" appearance when the button is hovered with the mouse.

My problem is that these buttons permanently have that "highlighte d" appearance after they have been clicked. With my XP theme, that happens to be an orange border.

Oddly enough, I can get the buttons to go back to their normal appearance if I have another control slightly overlapping them. This works in most cases, but is not a satisfactory solution.

All the buttons are in my form header. I don't think I'm doing anything in code to cause this to happen, but just in case, I've included code for one of the buttons below.

Has anyone run across this before? Does anyone know how to ensure the buttons go back to their "normal" appearance after they have been clicked?

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'Button to set the recordset of the form to the records associated with the
  3. 'last computer ID in my array (the array contains the computer IDs for 
  4. 'all the computers that matched search criteria specified by the user).
  5. 'Other buttons are similar-- they go to the first
  6. 'computer ID in the array, or increment or decrement current array index..
  7.  
  8. Private Sub lastComputer_Click()
  9. On Error GoTo Err_lastComputer_Click
  10.  
  11.     searchComputerIDArrayCurrent = UBound(searchComputerIDArray)
  12.     displayCurrentSearchResults
  13.  
  14.     'DoCmd.GoToRecord , , acLast
  15.  
  16. Exit_lastComputer_Click:
  17.     Exit Sub
  18.  
  19. Err_lastComputer_Click:
  20.     MsgBox Err.Description
  21.     Resume Exit_lastComputer_Click
  22.  
  23. End Sub
  24.  
  25. Public Sub displayCurrentSearchResults()
  26.  
  27.     'display the correct values in the combo boxes, even though they aren't enabled
  28.     computerComboBox = searchComputerIDArray(searchComputerIDArrayCurrent)
  29.     Me.subsystemComboBox.Value = Me.computerComboBox.Column(5)
  30.     Me.siteComboBox.Value = Me.computerComboBox.Column(4)
  31.  
  32.     'display the current record number in the navigation bar
  33.     Me.currentComputerTextBox = searchComputerIDArrayCurrent + 1
  34.  
  35.     'make sure the appropriate navigation buttons are enabled/disabled
  36.     Me.prevComputer.Enabled = True
  37.     Me.nextComputer.Enabled = True
  38.  
  39.     If (searchComputerIDArrayCurrent = LBound(searchComputerIDArray)) Then
  40.         Me.currentComputerTextBox.SetFocus
  41.         Me.prevComputer.Enabled = False
  42.     End If
  43.  
  44.     If (searchComputerIDArrayCurrent = UBound(searchComputerIDArray)) Then
  45.         Me.currentComputerTextBox.SetFocus
  46.         Me.nextComputer.Enabled = False
  47.     End If
  48.  
  49.     'requery the form
  50.     Me.Requery
  51.  
  52. End Sub
  53.  
Mar 20 '07 #1
11 5348
MMcCarthy
14,534 Recognized Expert Moderator MVP
Not sure why this is happening. Try adding and Me.Refresh at the end of the button click event code.

Mary
Mar 21 '07 #2
dana1
12 New Member
Mary,

Thanks for responding. No luck with the Me.Refresh, unfortunately. Any other ideas?

Even setting the Visible property to False and then back to True doesn't reset the way they're displayed, they still show that "highlight" permanently after they've been clicked. I also tried Me.Repaint, and that did not work either.

Thanks,
Dana
Mar 21 '07 #3
dana1
12 New Member
One thing that does appear to work is to disable/enable the button. Again, this isn't really a good solution...

But I guess it will work if we can't figure out why the behaviour is happening in the first place.

Expand|Select|Wrap|Line Numbers
  1. Private Sub lastComputer_Click()
  2. On Error GoTo Err_lastComputer_Click
  3.  
  4.     searchComputerIDArrayCurrent = UBound(searchComputerIDArray)
  5.     displayCurrentSearchResults
  6.     Me.currentComputerTextBox.SetFocus
  7.     Me.lastComputer.Enabled = False
  8.     Me.lastComputer.Enabled = True
  9.     Me.lastComputer.SetFocus
  10.  
  11.     'DoCmd.GoToRecord , , acLast
  12.  
  13. Exit_lastComputer_Click:
  14.     Exit Sub
  15.  
  16. Err_lastComputer_Click:
  17.     MsgBox Err.Description
  18.     Resume Exit_lastComputer_Click
  19.  
  20. End Sub
  21.  
Mar 21 '07 #4
dana1
12 New Member
....Actually... like the overlapping thing, this only works for some buttons. And, it ends up leaving a green "highlight" instead of an orange "highlight" (probably XP theme colors for something) on the buttons I use it on. The green highlight isn't permanent, but it displays or doesn't display depending on whether the button next to it is enabled/disabled (or so it appears).


[quote=dana1]One thing that does appear to work is to disable/enable the button. Again, this isn't really a good solution...
Mar 21 '07 #5
Denburt
1,356 Recognized Expert Top Contributor
May or may not be but are you sure you are using a command button and not a Toggle Button? I don't have my XP themes turned on my Machine is as plain looking as they come so I might not see what you are seeing but the only time my command button highlights is when I click on it and it always snaps back.

Return a Toggle Button:
Me!YourControlN ameHere.Value = 1
Mar 21 '07 #6
dana1
12 New Member
Denburt,

Good thought-- I hadn't thought to check that. Unfortunately, it does not appear that they are toggle buttons. I don't see how to tell the type of the control from the GUI, but the ControlType property returns 104, which is a command button. Also, the Value property isn't available from VB, so it appears that is not what is going on.

It's not really the "snapping back" part that is the problem. It does that just fine. It's just the orange border... It's the same orange border that I get when I hover any other button on any of my other forms, or even the buttons on this website (i.e., the Submit Reply or Preview Post buttons). The only difference is on this particular form, the orange border doesn't go away once you've clicked the button :-)

I've compared all the property settings on this button to other buttons that work just fine, and cannot figure out what the difference is..

Thanks for the suggestion! If you have any other ideas, let me know!

or.. if there's any more information that might help you be able to reproduce the behaviour on your machine, let me know and I'd be glad to provide it.

Dana


May or may not be but are you sure you are using a command button and not a Toggle Button? I don't have my XP themes turned on my Machine is as plain looking as they come so I might not see what you are seeing but the only time my command button highlights is when I click on it and it always snaps back.

Return a Toggle Button:
Me!YourControlN ameHere.Value = 1
Mar 21 '07 #7
Denburt
1,356 Recognized Expert Top Contributor
OK I set winXP themes and checked it out I wasn't able to reproduce your issue but I see how the highlighting is done now... Interesting situation you are describing and I can only suggest deleting that button and creating a new one. I have had some issues with widows themes acting screwy with my buttons before. I had one user download the frontend off the server and the buttons were the old style, user two downloaded the same database and the buttons had the themes style... I told them it was something they would just need to get used to lol. A few days later new update on the server (only a few minor code changes) both users had the themed style buttons go figure.

Wish I could offer something else to try, good luck.
Mar 21 '07 #8
dana1
12 New Member
Thanks Denburt. I'll try creating new buttons next week and let you know how that works out.

Dana
Mar 23 '07 #9
Denburt
1,356 Recognized Expert Top Contributor
Your welcome, and good luck let us know how it goes.
Mar 23 '07 #10

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

Similar topics

4
9335
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains several cards, in a card layout, which are displayed to the user one after the other as needed to present some particular mouse operation. This all works fine. One card (card 4 below) includes a textarea and a button. What I wish to do is have the user use the mouse to select some text from the...
1
4001
by: ehm | last post by:
I apologize in advance for the cross-post (from microsoft.public.inetexplorer.scripting), but that board seems dead. I have what I think is a fairly simple problem, but I cannot figure this out. I have a SELECT object on my page. When the user performs a certain action, I want the focus to be placed in the drop-down field AND the actual list of drop-down objects to appear (i.e. simulating that the user has clicked in that field). ...
235
11818
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could stay with C and still be able to produce Java byte code for platform independent apps. Also, old programs (with some tweaking) could be re-compiled and ported to the JVM. We have been developing such a tool over the last 2 years and currently...
0
902
by: coli | last post by:
I have 3 buttons. And basically, which ever get's clicked on should be highlighted, while the rest should return to normal. Currently, I'm using void Button3_Click(object sender, EventArgs e) { MultiView1.ActiveViewIndex = 1; Button1.Font.Bold = false; Button2.Font.Bold = false; Button3.Font.Bold = true;
22
130466
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the document and closes it with the following code: <body onload="window.print(); window.close();"> This works correctly (or at least the way I expect it to work under MS Internet Explorer, but it cuases Netscape to "crash"
1
1489
by: Jack | last post by:
Hello, On a form, I have a tab control with two tab pages. On one tab page, I have about seven group boxes which I hide and make visible when buttons are clicked on the tab page. No problems there. In one of these group boxes, I have a few combo boxes, however some of them are 'highlighted' for some reason when the groupbox is made visible. They're NOT selected nor have focus!. When the user tabs to, or selects then moves away from...
5
2526
by: Mark | last post by:
Hi All, I have 3 images stored which are to imitate a button. One for Normal, one for Depressed and another for Highlighted. The 'Normal' button is placed on the form. The Mousedown event changes the button to 'Depressed' The MouseUp event changes the button to 'Normal' How can I change the button to 'Highlighted when the mouse is over the image? I could use the mouseOver event to change this but when I move the
15
12553
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this property. Where is it? Or mabye change the other thing,No?Thanks ! Simon
0
1412
by: Curious | last post by:
I'm working on fixing the command of "Copy to Clipboard" from a data grid. The current implementation has two problems: 1) There are two extra columns copied to clipboard that are invisible in the grid. I'll need to remove these two columns from clipboard. 2) The headings are not being copied to clipboard.
0
10586
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
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
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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...
0
6856
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
5525
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...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
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.