Hello
I've searched, posted and solved this (Thanks for helping!), but now it came back to bite me in the *ss.
I have a Yes/No field that is represented by a check box in my form1.
I want to show another field (textbox) when the mouse pointer goes over the checkbox, and make it not visible when the mouse moves away from it.
My problem is that when I make the textbox diseappear, if the user set focus on it and moves the mouse away, Access gives me a "Can't hide a control while it has focus" error.
My question is: How can I resolve this problem?
I later added this: text2.SetFocus
I need to set focus on something else, but I can't do with the "when mouse moves on top of the form's background" thing, because then whenever the user moved the mouse on the background, the focus would be set to the same thing, i.e. user types in something to text1 (show/hide textbox) and then wants to change text3 (visible), but can't move the mouse because the focus would be set to text2.
This is the code I used: - Private Sub Chck1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = True
-
End Sub
-
-
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = False
-
End Sub
I will appreciate any help possible,
Thank you
10 10430
Hello
I've searched, posted and solved this (Thanks for helping!), but now it came back to bite me in the *ss.
I have a Yes/No field that is represented by a check box in my form1.
I want to show another field (textbox) when the mouse pointer goes over the checkbox, and make it not visible when the mouse moves away from it.
My problem is that when I make the textbox diseappear, if the user set focus on it and moves the mouse away, Access gives me a "Can't hide a control while it has focus" error.
My question is: How can I resolve this problem?
I later added this: text2.SetFocus
I need to set focus on something else, but I can't do with the "when mouse moves on top of the form's background" thing, because then whenever the user moved the mouse on the background, the focus would be set to the same thing, i.e. user types in something to text1 (show/hide textbox) and then wants to change text3 (visible), but can't move the mouse because the focus would be set to text2.
This is the code I used: - Private Sub Chck1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = True
-
End Sub
-
-
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = False
-
End Sub
I will appreciate any help possible,
Thank you
Outside the box...
create an unbound textbox or just a box that matches your background and large enough to cover up the Textbox in question. Make IT visible or invisible on top of your Textbox to "hide" it.
What if the textboxes that I need to hide are partially stacked? The boxes would either cover more than necessary, or show more than necessary.
I may be missing something here because I don't know what you mean about the 'form background' thing.
But assuming you have a checkbox (chkControlName) and say 2 text boxes on the form (txtName1 and txtName2). When mouse moves over checkbox it will display txtName1. After losing focus on txtName1 it will setfocus to txtName2 and hide txtName 1 again.
In the MouseMove event of chkControlName -
Me.txtName1.Visible = True
-
In the LostFocus event of txtName1 -
Me.txtName2.SetFocus
-
Me.txtName1.Visible = False
-
Does this help?
cheers,
Hello
I've searched, posted and solved this (Thanks for helping!), but now it came back to bite me in the *ss.
I have a Yes/No field that is represented by a check box in my form1.
I want to show another field (textbox) when the mouse pointer goes over the checkbox, and make it not visible when the mouse moves away from it.
My problem is that when I make the textbox diseappear, if the user set focus on it and moves the mouse away, Access gives me a "Can't hide a control while it has focus" error.
My question is: How can I resolve this problem?
I later added this: text2.SetFocus
I need to set focus on something else, but I can't do with the "when mouse moves on top of the form's background" thing, because then whenever the user moved the mouse on the background, the focus would be set to the same thing, i.e. user types in something to text1 (show/hide textbox) and then wants to change text3 (visible), but can't move the mouse because the focus would be set to text2.
This is the code I used: - Private Sub Chck1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = True
-
End Sub
-
-
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
text1.Visible = False
-
End Sub
I will appreciate any help possible,
Thank you
By "form background" I meant the part named "Detail", sorry :P
Yea, I was missing the LostFocus thingie.. Thanks.
Only problem now is that if the user passes the mouse pointer over the checkbox, the textbox1 will pop-up and not go away until the user clicks it (set focus on it) and then clicks some other textbox.
Is there anyway to control this? Perhaps a timer that does a condition where if the user does not set focus on the textbox1 after some time, it will disappear?
(I've no idea if you can do that)
Thanks for helping
Yes you can do that. You can setfocus to text1 if you want after moving the mouse over the checkbox (don't know if you want that though).
I will do the timer thing later today for you , I have to go see a client right now.
cheers,
By "form background" I meant the part named "Detail", sorry :P
Yea, I was missing the LostFocus thingie.. Thanks.
Only problem now is that if the user passes the mouse pointer over the checkbox, the textbox1 will pop-up and not go away until the user clicks it (set focus on it) and then clicks some other textbox.
Is there anyway to control this? Perhaps a timer that does a condition where if the user does not set focus on the textbox1 after some time, it will disappear?
(I've no idea if you can do that)
Thanks for helping
Thanks! Seriously, thank you :D
It'll help me alot.
Yes you can do that. You can setfocus to text1 if you want after moving the mouse over the checkbox (don't know if you want that though).
I will do the timer thing later today for you , I have to go see a client right now.
cheers,
Ok same scenario as before but I added a timer event. When you move over the check box TEXT1 will display for a set period of time if it does not have focus. If it has focus it will stay displayed. When you move off of it it will disappear again.
This goes in the MouseMove event of the check box -
' show your text box if mouse moves over the checkbox
-
Me.Text1.Visible = True
-
'start the timer event for a specified amount of time (increase for more time)
-
Me.Form.TimerInterval = 2000
-
This goes in the OnTimer event of the Form -
' determine if we are in the text box
-
' if so do nothing until we lose focus
-
If Me.ActiveControl.name = "Text1" Then
-
'do nothing
-
Else
-
Me.Text1.Visible = False
-
Me.Form.TimerInterval = 0
-
End If
-
Remove everything from the LostFocus event of Text1 (as from the previous code example)
cheers,
Thanks! Seriously, thank you :D
It'll help me alot.
Thank you so much!
Although I don't have the possibility to test it right now, I'll say something when I can.
Thanks
Yes, it works perfectly! Thank you :)
If only I could give you some kind of expert points :d
Thanks
You're welcome. Being able to help is good enough for me.
cheers,
Yes, it works perfectly! Thank you :)
If only I could give you some kind of expert points :d
Thanks
Sign in to post your reply or Sign up for a free account.
Similar topics
by: c.anandkumar |
last post by:
Hi All -
I have some problems getting a small piece of javascript working
correctly for Firefox. Here is what I am trying to do -
1. I have a form (like a search form)
2. I have many groups...
|
by: Alexander |
last post by:
I am building a little unique dialog editor and have derived some new
classes like DButton, DLabel and DTextBox. The user adds these
Controls to a panel which is part of a class Document which is...
|
by: Dan Neely |
last post by:
I want to have my textbox display a scrollbar if there is more text than will
fit, but to make it invisible if it will all fit. Is this possible?
The default behavior if all the text fits is a...
|
by: Amber |
last post by:
The DataGrid allows you to make columns visible or invisible on demand
- even edit and other special columns. This article will show you how
it is done.
Some developers have reported problems...
|
by: beccak |
last post by:
Hi,
I'm trying to hide a template column in a datagrid then later show it. I've
tried setting the visibility to false, but this doesn't let me get to the
underlying data in the column. I've tried...
|
by: Charlie Dison |
last post by:
Hi There,
Should I be able to show and hide panels in an asp.net page without
requiring a postback? I thought there was a way to do this using java
script. Can anyone give me an example? I...
|
by: Mike9900 |
last post by:
I am inheriting from a text box control and does not want the client see some
of the methods be invisible to the clients.
Mike
|
by: =?Utf-8?B?Sm9zaCBTY2htaWR0?= |
last post by:
I have a gridview that is being used for managing inventory. The default
view shows the stock currently available. When editing I don't want the
stock to be directly edited, rather the user will...
|
by: daoxx |
last post by:
Hi
Question#1
Is it possible to show a textbox (linked to a field) when the mouse pointer goes over a checkbox, and hiding it when the pointer goes away, and at the same time allowing the user to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
|
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...
|
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,...
| |