Click here to Skip to main content
15,901,283 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Combobox.SelectedItem assignment not working when adding items statically Pin
Michael Eber2-Jul-10 7:12
Michael Eber2-Jul-10 7:12 
GeneralRe: Combobox.SelectedItem assignment not working when adding items statically Pin
xtr33me2-Jul-10 9:14
xtr33me2-Jul-10 9:14 
Questionselected item for WPF ListBox [modified] Pin
devvvy2-Jul-10 3:00
devvvy2-Jul-10 3:00 
AnswerRe: selected item for WPF ListBox Pin
BechBej5-Jul-10 9:24
BechBej5-Jul-10 9:24 
GeneralRe: selected item for WPF ListBox Pin
devvvy5-Jul-10 16:04
devvvy5-Jul-10 16:04 
GeneralRe: selected item for WPF ListBox Pin
BechBej7-Jul-10 0:25
BechBej7-Jul-10 0:25 
GeneralRe: selected item for WPF ListBox [modified] Pin
devvvy7-Jul-10 16:00
devvvy7-Jul-10 16:00 
QuestionWPF Layout Databinding Help Pin
_Maxxx_1-Jul-10 20:34
professional_Maxxx_1-Jul-10 20:34 
Be gentle - this is all new to me!

OK - I have the below sitting on a user control - four progress bars and a text box.

I want the progress bars to each size to the width of the stackpanel - as you can see I have tried 4 different methods - only one of which comes close to doing what I want!

progressBar1 and 3 both appear tiny - despite the width being bound. I have noticed that changing the HorizontalAlignment to 'Stretch' changes that behaviour - but I'm confused!

progressBar2 stretches off the canvas and is clipped. Fair enough, I guess, it's the same width as the panel but starts somewhat to the right, so runs over to the right.

progressBar4 is a mystery to me. It's bound to the ActualWidth of textbox1 - which is pretty thin yet the progress bar appears quite wide - apparently arbitrarily wide?

What gives?

What I was actually trying to do was to have a couple of progress bars, one above the other, 'docked' so that they stretched width-ways with a resizing of the user control.

I suspect that the solution is obvious - so I'll make my excuses now. It's been a long week, and it's beer-o-clock - but what I'm really after is not only a solution, but a pointer to some sort of explanation as to what is going on in the layout.

 <StackPanel x:Name="p1" Margin="10">

    <ProgressBar Margin="12" Name="progressBar1" Height="18"  Width="{Binding ElementName=p1, Path=Width}" HorizontalAlignment="Left" />
    <ProgressBar Margin="12" Name="progressBar2" Height="18"  Width="{Binding ElementName=p1, Path=ActualWidth}" HorizontalAlignment="Left" />
    <ProgressBar Margin="12" Name="progressBar3" Height="18"  Width="{Binding ElementName=textBox1, Path=Width}" HorizontalAlignment="Left" />
    <ProgressBar Margin="12" Name="progressBar4" Height="18"  Width="{Binding ElementName=textBox1, Path=ActualWidth}" HorizontalAlignment="Left" />
    <TextBox Height="18" Name="textBox1"  Margin="12" HorizontalAlignment="Left" />
</StackPanel>


Thanks, in anticipation of enlightenment,
___________________________________________
.\\axxx
(That's an 'M')

AnswerRe: WPF Layout Databinding Help Pin
Pete O'Hanlon1-Jul-10 21:47
mvePete O'Hanlon1-Jul-10 21:47 
GeneralRe: WPF Layout Databinding Help Pin
_Maxxx_2-Jul-10 0:56
professional_Maxxx_2-Jul-10 0:56 
GeneralRe: WPF Layout Databinding Help Pin
Pete O'Hanlon2-Jul-10 1:11
mvePete O'Hanlon2-Jul-10 1:11 
Questionhide a group name in a wpf data grid Pin
Salman Haider1-Jul-10 19:52
Salman Haider1-Jul-10 19:52 
QuestionHow to make forward the MenuControl 's MenuBar list name its getting hide in my solution at run time Pin
Ch.Gayatri Subudhi1-Jul-10 18:55
Ch.Gayatri Subudhi1-Jul-10 18:55 
AnswerRe: How to make forward the MenuControl 's MenuBar list name its getting hide in my solution at run time Pin
Abhinav S1-Jul-10 20:10
Abhinav S1-Jul-10 20:10 
Questionget control name in a canvas Pin
ctlqt121-Jul-10 18:38
ctlqt121-Jul-10 18:38 
AnswerRe: get control name in a canvas Pin
Abhinav S1-Jul-10 20:02
Abhinav S1-Jul-10 20:02 
GeneralRe: get control name in a canvas Pin
ctlqt123-Jul-10 17:07
ctlqt123-Jul-10 17:07 
QuestionBinding to an objects member variable in a List Pin
xtr33me1-Jul-10 12:01
xtr33me1-Jul-10 12:01 
AnswerRe: Binding to an objects member variable in a List Pin
Venkatesh Mookkan1-Jul-10 17:44
Venkatesh Mookkan1-Jul-10 17:44 
GeneralRe: Binding to an objects member variable in a List Pin
xtr33me2-Jul-10 1:12
xtr33me2-Jul-10 1:12 
GeneralRe: Binding to an objects member variable in a List Pin
BechBej4-Jul-10 12:26
BechBej4-Jul-10 12:26 
QuestionHow to make Single instance application to run Pin
Joe Rozario1-Jul-10 2:32
Joe Rozario1-Jul-10 2:32 
AnswerRe: How to make Single instance application to run Pin
Not Active1-Jul-10 2:49
mentorNot Active1-Jul-10 2:49 
AnswerRe: How to make Single instance application to run Pin
Pete O'Hanlon1-Jul-10 2:57
mvePete O'Hanlon1-Jul-10 2:57 
GeneralRe: How to make Single instance application to run Pin
Joe Rozario4-Jul-10 18:27
Joe Rozario4-Jul-10 18:27 

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.