Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
mmm... now I've done it.
I made a keyboard, on-screen, for a touchscreen in a userform. Works great! It adds characters one at a time into a specific textbox. Oops.... Now I need to add a few more text boxes... and I want it to go into the text box with the current focus... problem is, which text box has the current focus? Because as soon as I press the keyboard keys (Label objects) it is *they* that have the current focus! Think I'm in a spot of trouble here :) Any ideas very much appreciated.... SMS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Userform has a property named ActiveControl. HTH sjoo. "rci" wrote: mmm... now I've done it. I made a keyboard, on-screen, for a touchscreen in a userform. Works great! It adds characters one at a time into a specific textbox. Oops.... Now I need to add a few more text boxes... and I want it to go into the text box with the current focus... problem is, which text box has the current focus? Because as soon as I press the keyboard keys (Label objects) it is *they* that have the current focus! Think I'm in a spot of trouble here :) Any ideas very much appreciated.... SMS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Labels cannot take focus. With this, focus always remains on the text box.
Private Sub Label1_Click() TextBox1.Text = TextBox1.Text & "A" End Sub Do you mean "ActiveControl" ? NickHK "rci" wrote in message ... mmm... now I've done it. I made a keyboard, on-screen, for a touchscreen in a userform. Works great! It adds characters one at a time into a specific textbox. Oops.... Now I need to add a few more text boxes... and I want it to go into the text box with the current focus... problem is, which text box has the current focus? Because as soon as I press the keyboard keys (Label objects) it is *they* that have the current focus! Think I'm in a spot of trouble here :) Any ideas very much appreciated.... SMS |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thx Nick, Well, that is good news... so, how do I find what text box (if any) has the current focus, and then, having that identified in a variable, how do I use that variable to enter text into the text box? Seems it would have to go like this: (psydocode) CurrentTextBox = Me.HasFocus CurrentTextox.value = CurrentTextBox.value & NewKeyPressed Looks simple enough... how come I doubt it is :-) Thx! NickHK wrote: : Labels cannot take focus. With this, focus always remains on the text box. : Private Sub Label1_Click() : TextBox1.Text = TextBox1.Text & "A" : End Sub : Do you mean "ActiveControl" ? : NickHK : "rci" wrote in message : ... : mmm... now I've done it. : : I made a keyboard, on-screen, for a touchscreen in a userform. Works : great! : It adds characters one at a time into a specific textbox. : : Oops.... : : Now I need to add a few more text boxes... and I want it to go into the : text : box with the current focus... problem is, which text box has the current : focus? Because as soon as I press the keyboard keys (Label objects) it is : *they* that have the current focus! : : Think I'm in a spot of trouble here :) : : Any ideas very much appreciated.... : : SMS |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The form has an Activecontrol property.
Private Sub Label1_Click() ActiveControl.Text = ActiveControl.Text & " A" End Sub Depending on your form/needs, you should check what the ActiveControl is. If TypeOf ActiveControl Is MSForms.TextBox Then .. NickHK "rci" wrote in message ... Thx Nick, Well, that is good news... so, how do I find what text box (if any) has the current focus, and then, having that identified in a variable, how do I use that variable to enter text into the text box? Seems it would have to go like this: (psydocode) CurrentTextBox = Me.HasFocus CurrentTextox.value = CurrentTextBox.value & NewKeyPressed Looks simple enough... how come I doubt it is :-) Thx! NickHK wrote: : Labels cannot take focus. With this, focus always remains on the text box. : Private Sub Label1_Click() : TextBox1.Text = TextBox1.Text & "A" : End Sub : Do you mean "ActiveControl" ? : NickHK : "rci" wrote in message : ... : mmm... now I've done it. : : I made a keyboard, on-screen, for a touchscreen in a userform. Works : great! : It adds characters one at a time into a specific textbox. : : Oops.... : : Now I need to add a few more text boxes... and I want it to go into the : text : box with the current focus... problem is, which text box has the current : focus? Because as soon as I press the keyboard keys (Label objects) it is : *they* that have the current focus! : : Think I'm in a spot of trouble here :) : : Any ideas very much appreciated.... : : SMS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Anyone screwed over with student loans? | Excel Discussion (Misc queries) | |||
Sell Program - Screwed by Managers !!! | Excel Programming | |||
Sell Program - Screwed by Managers !!! | Excel Programming | |||
Help Please, screwed up big time | New Users to Excel | |||
User screwed up | Excel Discussion (Misc queries) |