Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Set focus to textbox after spin-button control is pressed??

I try this an have same problem. it seem that where focus is at click
control where focus go. if focus on spinner then focis go to textbox. but
if focus on text box it go to spinner. i think what happen is actually
click on spinner set focus to spinner after code set it to text box. i not
find a answer that work all the time.


"Robert Crandal" wrote in message
...
| My userform contains one Textbox and one vertical Spinbutton control.
| If someone presses either the spin-up or spin-down button, I want
| the input focus to immediately change from the spinbutton to the
| textbox control. I tried using the code below:
|
| Private Sub SpinButton1_SpinDown()
| UserForm1.TextBox1.SetFocus
| End Sub
|
| Private Sub SpinButton1_SpinUp()
| UserForm1.TextBox1.SetFocus
| End Sub
|
|
| I thought the code above would be sufficient, but sometimes when
| I press either spin button the focus does not change immediately
| to the textbox control. It seems like the user has to press the same
| spin button twice just to change the focus.
|
| Does anybody know how to set this up so that if any spin button
| is pressed the focus will immediately leave the spinbutton and go
| somewhere else (i.e to the textbox control)
|
| thank you
|
|

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default Set focus to textbox after spin-button control is pressed??

I found a solution that worked for me.....

I simply used 2 command buttons to act as spin-up and spin-down
controls. I put an image of an up and down arrow on each button
just to make them look like an actual spin control!




"Homey" <none wrote in message
...
I try this an have same problem. it seem that where focus is at click
control where focus go. if focus on spinner then focis go to textbox. but
if focus on text box it go to spinner. i think what happen is actually
click on spinner set focus to spinner after code set it to text box. i
not
find a answer that work all the time.



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
Changing Cell Link on Spin Button Form Control Adam Ronalds Excel Discussion (Misc queries) 14 August 27th 09 05:52 PM
always the specific control has focus when F3 or Ctrl+q is pressed x taol Excel Programming 0 October 23rd 06 01:14 AM
Spin Button control change capture in ThisWorkbook Module STEVE BELL Excel Programming 0 September 12th 05 09:35 PM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM
Command/option/spin button - no control menu available Daniel[_7_] Excel Programming 3 March 5th 04 04:02 PM


All times are GMT +1. The time now is 08:21 AM.

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"