Click here to Skip to main content
15,891,473 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 8:43
fjparisIII22-Jan-10 8:43 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 9:45
hb5213421422-Jan-10 9:45 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 12:32
fjparisIII22-Jan-10 12:32 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 13:55
hb5213421422-Jan-10 13:55 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 15:31
fjparisIII22-Jan-10 15:31 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Kasim_Husaini20-Oct-10 20:02
Kasim_Husaini20-Oct-10 20:02 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Gideon Engelberth22-Jan-10 12:46
Gideon Engelberth22-Jan-10 12:46 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
fjparisIII22-Jan-10 15:21
fjparisIII22-Jan-10 15:21 
The most important thing you wrote in your post is the following:

Gideon Engelberth wrote:
If you do leave this as a UserControl, you should take out the explicit ScrollViewer since the ListBox will create a ScrollViewer internally if needed.


Removing ScrollViewer solved all my problems! It now wraps properly on the fly whether I make the dialog wider or narrower. Thank you very much for pointing this out. I thought only TextBox and RichTextBox had built-in scrollbars.

But let me comment on your other suggestion that I define a style instead of creating a UserControl. I did not embark on this decision lightly! The code behind in the UserControl is about 600 lines of C#. There is all kinds of data analysis required to style the individual ListBoxItems: different colors, different font styles, different font weights, underlining, all determined by the semantics of what the user types in. The original content of each ListBoxItem starts out as a TextBox that the user can type into. When he presses the Enter key, the code behind changes the ListBoxItem.Content to either a heavily styled TextBlock or a horizontal StackPanel with graphics and a styled TextBlock. The graphics in the StackPanel indicates to the user what will happen when he double-clicks the containing ListBoxItem. There are also several custom dependency properties and routed events that are defined in the UserControl. I don't think all this could be done just with styles.

I removed the Name (residual when I was trying various incarnations of FindName that did not work), IsItemsHost, and HorizontalAlignment.
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
Gideon Engelberth22-Jan-10 19:14
Gideon Engelberth22-Jan-10 19:14 
QuestionPage loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 9:03
Michael Eber21-Jan-10 9:03 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Mark Salsbery21-Jan-10 13:52
Mark Salsbery21-Jan-10 13:52 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 19:05
Michael Eber21-Jan-10 19:05 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Abhinav S21-Jan-10 19:24
Abhinav S21-Jan-10 19:24 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber22-Jan-10 12:43
Michael Eber22-Jan-10 12:43 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Abhinav S22-Jan-10 20:52
Abhinav S22-Jan-10 20:52 
Questionisolated storage Pin
Tauseef A20-Jan-10 21:19
Tauseef A20-Jan-10 21:19 
AnswerRe: isolated storage Pin
Mark Salsbery21-Jan-10 5:37
Mark Salsbery21-Jan-10 5:37 
AnswerRe: isolated storage Pin
Abhinav S21-Jan-10 17:30
Abhinav S21-Jan-10 17:30 
AnswerRe: isolated storage Pin
fred_5-Feb-10 10:18
fred_5-Feb-10 10:18 
QuestionListView Style ? Pin
Mohammad Dayyan19-Jan-10 7:52
Mohammad Dayyan19-Jan-10 7:52 
AnswerRe: ListView Style ? Pin
AspDotNetDev19-Jan-10 21:02
protectorAspDotNetDev19-Jan-10 21:02 
QuestionGetting an Item Template to raise selected event properly Pin
Michael Eber19-Jan-10 6:04
Michael Eber19-Jan-10 6:04 
AnswerRe: Getting an Item Template to raise selected event properly Pin
Mark Salsbery19-Jan-10 6:23
Mark Salsbery19-Jan-10 6:23 
GeneralRe: Getting an Item Template to raise selected event properly Pin
Michael Eber19-Jan-10 6:29
Michael Eber19-Jan-10 6:29 
GeneralRe: Getting an Item Template to raise selected event properly Pin
Mark Salsbery19-Jan-10 6:32
Mark Salsbery19-Jan-10 6:32 

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.