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? -
-
'Button to set the recordset of the form to the records associated with the
-
'last computer ID in my array (the array contains the computer IDs for
-
'all the computers that matched search criteria specified by the user).
-
'Other buttons are similar-- they go to the first
-
'computer ID in the array, or increment or decrement current array index..
-
-
Private Sub lastComputer_Click()
-
On Error GoTo Err_lastComputer_Click
-
-
searchComputerIDArrayCurrent = UBound(searchComputerIDArray)
-
displayCurrentSearchResults
-
-
'DoCmd.GoToRecord , , acLast
-
-
Exit_lastComputer_Click:
-
Exit Sub
-
-
Err_lastComputer_Click:
-
MsgBox Err.Description
-
Resume Exit_lastComputer_Click
-
-
End Sub
-
-
Public Sub displayCurrentSearchResults()
-
-
'display the correct values in the combo boxes, even though they aren't enabled
-
computerComboBox = searchComputerIDArray(searchComputerIDArrayCurrent)
-
Me.subsystemComboBox.Value = Me.computerComboBox.Column(5)
-
Me.siteComboBox.Value = Me.computerComboBox.Column(4)
-
-
'display the current record number in the navigation bar
-
Me.currentComputerTextBox = searchComputerIDArrayCurrent + 1
-
-
'make sure the appropriate navigation buttons are enabled/disabled
-
Me.prevComputer.Enabled = True
-
Me.nextComputer.Enabled = True
-
-
If (searchComputerIDArrayCurrent = LBound(searchComputerIDArray)) Then
-
Me.currentComputerTextBox.SetFocus
-
Me.prevComputer.Enabled = False
-
End If
-
-
If (searchComputerIDArrayCurrent = UBound(searchComputerIDArray)) Then
-
Me.currentComputerTextBox.SetFocus
-
Me.nextComputer.Enabled = False
-
End If
-
-
'requery the form
-
Me.Requery
-
-
End Sub
-
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
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
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. -
Private Sub lastComputer_Click()
-
On Error GoTo Err_lastComputer_Click
-
-
searchComputerIDArrayCurrent = UBound(searchComputerIDArray)
-
displayCurrentSearchResults
-
Me.currentComputerTextBox.SetFocus
-
Me.lastComputer.Enabled = False
-
Me.lastComputer.Enabled = True
-
Me.lastComputer.SetFocus
-
-
'DoCmd.GoToRecord , , acLast
-
-
Exit_lastComputer_Click:
-
Exit Sub
-
-
Err_lastComputer_Click:
-
MsgBox Err.Description
-
Resume Exit_lastComputer_Click
-
-
End Sub
-
....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...
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
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
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.
Thanks Denburt. I'll try creating new buttons next week and let you know how that works out.
Dana
Denburt 1,356
Recognized Expert Top Contributor
Your welcome, and good luck let us know how it goes.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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). ...
|
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...
|
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;
|
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"
| |
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...
|
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
|
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
|
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.
|
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...
|
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,...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |