Click here to Skip to main content
15,913,486 members
Home / Discussions / WPF
   

WPF

 
QuestionError while running WPF, DirectShowNet application in Vista Pin
Vishaal K. Menon6-Oct-08 0:07
Vishaal K. Menon6-Oct-08 0:07 
QuestionXAML Power Toys 3.1.0.2 Has Silverlight 2 Support! Pin
User 2710095-Oct-08 12:56
User 2710095-Oct-08 12:56 
AnswerRe: XAML Power Toys 3.1.0.2 Has Silverlight 2 Support! Pin
Syed Mehroz Alam8-Oct-08 19:02
Syed Mehroz Alam8-Oct-08 19:02 
AnswerWhat about Mole Pin
Syed Mehroz Alam9-Oct-08 19:51
Syed Mehroz Alam9-Oct-08 19:51 
GeneralRe: What about Mole Pin
User 27100910-Oct-08 0:34
User 27100910-Oct-08 0:34 
GeneralRe: What about Mole Pin
jandersen7830-Apr-09 11:15
jandersen7830-Apr-09 11:15 
QuestionPlease Help Pin
mabbas_865-Oct-08 6:58
mabbas_865-Oct-08 6:58 
AnswerRe: Please Help Pin
User 2710095-Oct-08 14:23
User 2710095-Oct-08 14:23 
GeneralRe: Please Help Pin
mabbas_865-Oct-08 19:55
mabbas_865-Oct-08 19:55 
GeneralRe: Please Help Pin
User 2710096-Oct-08 0:35
User 2710096-Oct-08 0:35 
QuestionHelp with a WPF Combobox Pin
Aaron Hickman2-Oct-08 14:11
Aaron Hickman2-Oct-08 14:11 
AnswerRe: Help with a WPF Combobox Pin
User 2710092-Oct-08 15:52
User 2710092-Oct-08 15:52 
GeneralRe: Help with a WPF Combobox Pin
Aaron Hickman2-Oct-08 17:06
Aaron Hickman2-Oct-08 17:06 
GeneralRe: Help with a WPF Combobox Pin
User 2710092-Oct-08 17:11
User 2710092-Oct-08 17:11 
GeneralRe: Help with a WPF Combobox Pin
Aaron Hickman2-Oct-08 17:58
Aaron Hickman2-Oct-08 17:58 
GeneralRe: Help with a WPF Combobox Pin
User 2710092-Oct-08 18:28
User 2710092-Oct-08 18:28 
GeneralRe: Help with a WPF Combobox Pin
Aaron Hickman2-Oct-08 18:33
Aaron Hickman2-Oct-08 18:33 
GeneralRe: Help with a WPF Combobox Pin
User 2710095-Oct-08 14:17
User 2710095-Oct-08 14:17 
GeneralRe: Help with a WPF Combobox Pin
ColinM1237-Oct-08 13:15
ColinM1237-Oct-08 13:15 
GeneralRe: Help with a WPF Combobox Pin
User 27100911-Oct-08 14:28
User 27100911-Oct-08 14:28 
AnswerSolution: Re: Help with a WPF Combobox Pin
User 27100911-Oct-08 16:53
User 27100911-Oct-08 16:53 
Below are two solutions. One when the ComboBox ItemSource is data bound. The second when the ComboBox items are added in-line.

You can thank Code Project MVP Josh Smith for this solution. He is the real, "Man" and Mr. WPF.

Josh's blog: http://joshsmithonwpf.wordpress.com/

<!-- Use this when data binding your items source-->
<ComboBox ItemsSource="{Binding}" Width="100" VerticalAlignment="Center">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{TemplateBinding Content}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>

<!-- Use this when adding items in-line to your ComboBox-->
<ComboBox Width="100" VerticalAlignment="Center" SelectedIndex="0">
<ComboBox.Resources>
<Style TargetType="ComboBoxItem">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{TemplateBinding Content}"
TextTrimming="CharacterEllipsis"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ComboBox.Resources>
<ComboBoxItem>Greetings from the planet known as Earth</ComboBoxItem>
<ComboBoxItem>Thanks to Josh Smith for this tip!</ComboBoxItem>
</ComboBox>

Cheers, Karl

&raquo; CodeProject 2008 MVP

My Blog | Mole's Home Page |
XAML Power Toys Home Page
Just a grain of sand on the worlds beaches.

-- modified 27-Feb-21 21:01pm.
GeneralRe: Solution: Re: Help with a WPF Combobox Pin
Aaron Hickman11-Oct-08 17:22
Aaron Hickman11-Oct-08 17:22 
GeneralRe: Solution: Re: Help with a WPF Combobox Pin
User 27100911-Oct-08 17:29
User 27100911-Oct-08 17:29 
QuestionAjax Tool Error Pin
gautamamit81-Oct-08 22:14
gautamamit81-Oct-08 22:14 
GeneralWrong forum Pin
Pete O'Hanlon1-Oct-08 23:13
mvePete O'Hanlon1-Oct-08 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.