Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: TextBox with ProgressBar

Is it possible in WPF to embed a ProgressBar in the Background of a TextBox?

like image 560
MarcelMalik Avatar asked Sep 07 '09 12:09

MarcelMalik


1 Answers

Yes, but there are varying levels of integration you could achieve.

The simplest way would be to host a ProgressBar and TextBox with see-through background in the same Grid:

<Grid>
    <ProgressBar/>
    <TextBox Background="#00ffffff"/>
</Grid>

Importantly, the background color is transparent but visible to hit testing. #00000000 would not work as expected because clicking on the TextBox would actually be clicking on the ProgressBar.

You could also retemplate the TextBox to incorporate the ProgressBar more intrinsically into its template. However, this would be of limited use unless you wrote your own control while you're at it.

like image 164
Kent Boogaart Avatar answered Nov 14 '22 21:11

Kent Boogaart