Nicolas Bordeleau
Posts: 20
Joined: 2008-03-24
|
I added a Keyboard Shortcut, and I want to link it to a textbox (inside my UserControl) I added in the CommandBar. Keyboard Shortcut event work, but the problem is that I can't set the focus on the textbox of my UserControl. Either myTextBox.Focus() or myTextBox.Select() won't work. Any clue?
Thanks,
Nicolas
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
Joined: 2004-04-05
|
Hi Nicolas,
You need to use the ActiveInstance property. Please see the code below:
private void adxCommandBarButton1_Click(object sender)
{
TextBox activeTextBox = adxCommandBarAdvancedControl1.ActiveInstance as TextBox;
if (activeTextBox != null)
activeTextBox.Focus();
}
|
|