Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy cells to a txtbox SMERTZ Excel Programming 1 March 28th 06 02:58 PM
Keeping The Focus From Changing. How? abxy[_74_] Excel Programming 9 August 31st 05 09:08 PM
txtbox problem [email protected] Excel Programming 0 May 18th 05 05:11 PM
To put value from txtbox to cell? Samick Excel Programming 1 November 13th 04 10:57 AM
txtbox code Sal_sal Excel Programming 1 December 12th 03 11:25 AM


All times are GMT +1. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"