Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keeping focus on a txtbox
I have txt1 on a form which should always get focus after any other
control is used. I have a spin button which I use to change the value in txt2. When I click the spin button, if I use txt1.setfocus at the end of the spinup and spindown events, txt1 only receives the focus every second click. Why is this? The only way I have found to keep the focus on txt1 is by placing the txt1.setfocus in the 'enter' event, but then the spin button has no effect. How can I keep the focus on txt1 and still allow the spin button to have an effect? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keeping focus on a txtbox
Hi Tim,
Give all other control the property "TabStop" to false for text boxes or TakeFocusOnClick for button, etc to false That way only your Text1 can get the focus Regards Jean-Yves "Tim" wrote in message ups.com... I have txt1 on a form which should always get focus after any other control is used. I have a spin button which I use to change the value in txt2. When I click the spin button, if I use txt1.setfocus at the end of the spinup and spindown events, txt1 only receives the focus every second click. Why is this? The only way I have found to keep the focus on txt1 is by placing the txt1.setfocus in the 'enter' event, but then the spin button has no effect. How can I keep the focus on txt1 and still allow the spin button to have an effect? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keeping focus on a txtbox
All controls have the tabstop set to false except Text1.
Thanks for the info on TakeFocusOnClick, but it doesn't help for a spinner. I still have the same problem. -Tim |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keeping focus on a txtbox
Hi Tim,
Yes, just tried it ... Then you have to give focus to the textbox by code at the end of you spinner code Regards JY "Tim" wrote in message oups.com... All controls have the tabstop set to false except Text1. Thanks for the info on TakeFocusOnClick, but it doesn't help for a spinner. I still have the same problem. -Tim |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keeping focus on a txtbox
I already do. Tried one other thing; a breakpoint on the .setfocus to
see if the event was actually occuring. It was. The extra pause given by stopping at the breakpoint allowed the system to work as expected. But when I remove the breakpoint, the same problem is back. Any more ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy cells to a txtbox | Excel Programming | |||
Keeping The Focus From Changing. How? | Excel Programming | |||
txtbox problem | Excel Programming | |||
To put value from txtbox to cell? | Excel Programming | |||
txtbox code | Excel Programming |