Click here to Skip to main content
15,908,015 members
Home / Discussions / WPF
   

WPF

 
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 
AnswerRe: WPF Layout Databinding Help Pin
Pete O'Hanlon1-Jul-10 21:47
mvePete O'Hanlon1-Jul-10 21:47 
Right - an explanation as to what's going wrong:
<ProgressBar Margin="12" Name="progressBar1" Height="18"  Width="{Binding ElementName=p1, Path=Width}" HorizontalAlignment="Left" />
Drop the HorizontalAlignment, that's overriding the Width.

Secondly - this binds to the ActualWidth, but the Margin has an effect, so the actually means that the progress bar extends beyond the margin of the stack panel. Drop the Width setting altogether as it's not needed.
<ProgressBar Margin="12" Name="progressBar2" Height="18"  Width="{Binding ElementName=p1, Path=ActualWidth}" HorizontalAlignment="Left" />
If you change all this to the following, you get to see the actual effect of what you are doing:
<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel x:Name="p1" Margin="10">
        <ProgressBar Margin="12" Name="progressBar1" Height="18" Width="{Binding ElementName=p1, Path=Width}"/>
        <ProgressBar Margin="12" Name="progressBar2" Height="18"  />
        <ProgressBar Margin="12" Name="progressBar3" Height="18"  Width="{Binding ElementName=textBox1, Path=Width}" />
        <ProgressBar Margin="12" Name="progressBar4" Height="18"  Width="{Binding ElementName=textBox1, Path=ActualWidth}" />
        <TextBox Height="18" Name="textBox1"  Margin="12" HorizontalAlignment="Left" Width="20" />
    </StackPanel>
</Page>

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



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 
GeneralRe: How to make Single instance application to run Pin
Pete O'Hanlon4-Jul-10 21:50
mvePete O'Hanlon4-Jul-10 21:50 

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.