Click here to Skip to main content
15,892,059 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Help with textbox for calculator Pin
Sonar8716-Mar-10 18:26
Sonar8716-Mar-10 18:26 
GeneralRe: Help with textbox for calculator Pin
guyet053-Aug-10 17:25
guyet053-Aug-10 17:25 
Questionhow to use silverlight tool in .aspx page Pin
DX Roster14-Mar-10 20:22
DX Roster14-Mar-10 20:22 
AnswerRe: how to use silverlight tool in .aspx page Pin
Abhinav S14-Mar-10 20:44
Abhinav S14-Mar-10 20:44 
QuestionC# code Equivalent in wpf Pin
amir-haghighi13-Mar-10 7:15
amir-haghighi13-Mar-10 7:15 
AnswerRe: C# code Equivalent in wpf Pin
Super Lloyd15-Mar-10 11:15
Super Lloyd15-Mar-10 11:15 
QuestionTab ordering in WPF controls. Pin
SRKSHOME11-Mar-10 23:15
SRKSHOME11-Mar-10 23:15 
QuestionWPF TextBox shrinks but Stackpanel doesn't Pin
Marcelo Ricardo de Oliveira11-Mar-10 8:58
Marcelo Ricardo de Oliveira11-Mar-10 8:58 
Hi
I have a problem when using a TextBox with TextWrapping=Wrap which is inside a DataTemplate which is inside a ListBox which is inside a StackPanel.

The problem is: when I add new lines to the TextBox, both the ListBox and the StackPanel expand accordingly, but when I remove lines from the TextBox, the ListBox shrinks, but the container StackPanel doesn't shrink (it keeps the same height). That is, the TextBox height causes the DockPanel only to grow.

<StackPanel>
   <ListBox>
      <ListBox.Resources>
         <DataTemplate>
<TextBox AcceptsReturn="True" 
TextWrapping="Wrap" 
Text="{Binding Path=Text, Mode=TwoWay}" 
Text="{Binding Path=SomeProperty, Mode=TwoWay}" />
         </DataTemplate>
      </ListBox.Resources>
   </ListBox>
</StackPanel>


This seems to be a ListBox/DataTemplate problem. Is it a known bug? Does it have a workaround? (please say "yes"...)

Thanks in advance!
Take a look at XNA Snooker Club game here in Code Project.

AnswerRe: WPF TextBox shrinks but Stackpanel doesn't Pin
Super Lloyd15-Mar-10 2:24
Super Lloyd15-Mar-10 2:24 
GeneralRe: WPF TextBox shrinks but Stackpanel doesn't Pin
Marcelo Ricardo de Oliveira15-Mar-10 5:52
Marcelo Ricardo de Oliveira15-Mar-10 5:52 
GeneralRe: WPF TextBox shrinks but Stackpanel doesn't Pin
Super Lloyd15-Mar-10 11:10
Super Lloyd15-Mar-10 11:10 
GeneralRe: WPF TextBox shrinks but Stackpanel doesn't Pin
Marcelo Ricardo de Oliveira17-Mar-10 12:21
Marcelo Ricardo de Oliveira17-Mar-10 12:21 
QuestionMost popular technology? Pin
Mark Walter Smith11-Mar-10 5:02
Mark Walter Smith11-Mar-10 5:02 
AnswerRe: Most popular technology? Pin
Abhinav S14-Mar-10 20:07
Abhinav S14-Mar-10 20:07 
QuestionUse HTML5 or otherwise? Pin
Mark Walter Smith11-Mar-10 4:59
Mark Walter Smith11-Mar-10 4:59 
AnswerRe: Use HTML5 or otherwise? Pin
Alan Beasley22-Mar-10 2:39
Alan Beasley22-Mar-10 2:39 
QuestionKeyBoard shortcuts Pin
SRKSHOME11-Mar-10 1:00
SRKSHOME11-Mar-10 1:00 
AnswerRe: KeyBoard shortcuts Pin
Pete O'Hanlon11-Mar-10 1:18
mvePete O'Hanlon11-Mar-10 1:18 
GeneralRe: KeyBoard shortcuts Pin
SRKSHOME11-Mar-10 2:33
SRKSHOME11-Mar-10 2:33 
GeneralRe: KeyBoard shortcuts Pin
Pete O'Hanlon11-Mar-10 2:45
mvePete O'Hanlon11-Mar-10 2:45 
GeneralRe: KeyBoard shortcuts Pin
SRKSHOME11-Mar-10 3:41
SRKSHOME11-Mar-10 3:41 
QuestionMessage Removed Pin
10-Mar-10 3:17
professionalN_tro_P10-Mar-10 3:17 
AnswerRe: ObservableCollection Changed Pin
Pete O'Hanlon10-Mar-10 4:14
mvePete O'Hanlon10-Mar-10 4:14 
GeneralMessage Removed Pin
11-Mar-10 3:05
professionalN_tro_P11-Mar-10 3:05 
GeneralMessage Removed Pin
11-Mar-10 3:15
professionalN_tro_P11-Mar-10 3:15 

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.