Customizing Foreground (the moving part) of a progressbar in WPF
-
Hi guys, I am really new to WPF. I unerstand the concept of using Templates to create customization of a control, and i have attempted to change the visual behaviour of the Progressbar control and now hitting a brick wall. So there are 3 things i would like to do: 1) Remove the 3d shiny part of the control - i dont like the 3d ness I used control template to modify the foreground, i sucessfully killed the 3d shininesss, but moving part is expanding itself starting at the center point of the entire progress bar, and that it only expends to 100 pixels wide. this is because i set te Width=Value the foreground rectrangle's width attribute. How do i make it so that when the value = 100, the progressbar is fully filled?
<Rectangle Fill="{TemplateBinding Foreground}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Width}" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}" Margin="0,0" ></Rectangle>
- Have a textbox following the top of the moving part to indicate a value - I have no idea how to do this 3) Make the whole control an arc, so that it looks like a fuel gauge - I know i can transform it,skew, size it whatever, but not warp it. thx alot guys
-
Hi guys, I am really new to WPF. I unerstand the concept of using Templates to create customization of a control, and i have attempted to change the visual behaviour of the Progressbar control and now hitting a brick wall. So there are 3 things i would like to do: 1) Remove the 3d shiny part of the control - i dont like the 3d ness I used control template to modify the foreground, i sucessfully killed the 3d shininesss, but moving part is expanding itself starting at the center point of the entire progress bar, and that it only expends to 100 pixels wide. this is because i set te Width=Value the foreground rectrangle's width attribute. How do i make it so that when the value = 100, the progressbar is fully filled?
<Rectangle Fill="{TemplateBinding Foreground}" Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Width}" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}" Margin="0,0" ></Rectangle>
- Have a textbox following the top of the moving part to indicate a value - I have no idea how to do this 3) Make the whole control an arc, so that it looks like a fuel gauge - I know i can transform it,skew, size it whatever, but not warp it. thx alot guys
what about a template just a guess, but a "like" that (warning: pseudo xaml code below)
template
grid
background
viewbox
grid with 100
rectangle LeftAlign with=ValueA train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
what about a template just a guess, but a "like" that (warning: pseudo xaml code below)
template
grid
background
viewbox
grid with 100
rectangle LeftAlign with=ValueA train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.