Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Mnemonics in WPF ComboBox

 
 
Old 10-16-2007   #1 (permalink)
Oleg Ogurok


 
 

Mnemonics in WPF ComboBox

Hi there,

I have a WPF combobox with two values "Male" and "Female". It seems
by
default the control supports mnemonics, e.g. if I press "M" on
keyboard, it sets the current ComboBoxItem to "Male"


If I use non-textual items, e.g. images+labels inside ComboBox, is
there a way hardcode such keyboard shortcut for each item?


E.g.


<ComboBox Margin="59,0,66,16" Name="comboBox1" Height="82"
VerticalAlignment="Bottom" >
<ComboBoxItem>
<StackPanel Orientation="Horizontal">
<Image Source="Male.jpg" />
<Label VerticalAlignment="Center"
Margin="4">_Male</Label>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem>
<StackPanel Orientation="Horizontal">
<Image Source="Female.jpg" />
<Label VerticalAlignment="Center"
Margin="4">_Female</Label>
</StackPanel>
</ComboBoxItem>
</ComboBox>


Thanks,


-Oleg.


My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46