Valid ADXKeyboardShortcut keys?

Add-in Express™ Support Service
That's what is more important than anything else

Valid ADXKeyboardShortcut keys?
 
David Ing




Posts: 56
Joined: 2006-06-27
Hello to Belarus!

I am using the ADXKeyboardShortcut feature. It works great.

What I now want to do is present the user with a combobox of valid/available key bindings, so they can set their own in my Outlook Addin for a shortcut.

Is there a way to get these values back from ADX, or do I have to manually copy that (really) long list from the ADXKeyboardShortcut design time control myself?

"Ctrl+A, Ctrl+Add etc. etc." :-)

Thanks for any help.
Posted 12 Jul, 2006 14:10:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi David.

You can use the code below to loop through all ADXKeyboardShortcut components in the addinmodule container:

for(int i = 0; i<this.GetContainer().Components.Count; i++)
{
if (this.GetContainer().Components[i] is AddinExpress.MSO.ADXKeyboardShortcut)
{
}
}
Posted 13 Jul, 2006 06:58:16 Top
David Ing




Posts: 56
Joined: 2006-06-27
Sorry Sergey for not being clearer, I meant valid values for the ADXKeyboardShortcut instances, i.e. their key allocations...
Posted 13 Jul, 2006 08:12:20 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Oh...

Please use the code below (this is the code of the ShortcutText property editor):

public ADXShortcutEditor()
{
char c = (char)0x00;
listBox = new System.Windows.Forms.ListBox();
listBox.MouseUp += new MouseEventHandler(this.listBox_MouseUp);
listBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
listBox.HorizontalScrollbar = true;
listBox.Sorted = true;
listBox.BeginUpdate();
listBox.Items.Add("(none)");
for(int i=48; i<=90; i++)
{
c = Convert.ToChar(i);
if (char.IsLetter©)
{
listBox.Items.Add("Ctrl+" + Globals.ToUpperADXChar©);
listBox.Items.Add("Shift+" + Globals.ToUpperADXChar©);
listBox.Items.Add("Ctrl+Shift+" + Globals.ToUpperADXChar©);
}
else if (char.IsDigit©)
{
listBox.Items.Add("Ctrl+D" + Globals.ToUpperADXChar©);
listBox.Items.Add("Shift+D" + Globals.ToUpperADXChar©);
listBox.Items.Add("Ctrl+Shift+D" + Globals.ToUpperADXChar©);
}
}
for(int i=1; i<=12; i++)
{
listBox.Items.Add("Ctrl+F" + i.ToString());
listBox.Items.Add("Shift+F" + i.ToString());
listBox.Items.Add("Ctrl+Shift+F" + i.ToString());
}
AddAdditionalShortcuts("Ctrl");
AddAdditionalShortcuts("Shift");
AddAdditionalShortcuts("Ctrl+Shift");
listBox.EndUpdate();
listBox.Height = 180;
listBox.Width = 150;
}
Posted 13 Jul, 2006 08:24:55 Top
David Ing




Posts: 56
Joined: 2006-06-27
That's just what I wanted - thanks!
Posted 13 Jul, 2006 10:26:44 Top