views:

111

answers:

1

Behold the code below:

   <Grid>
        <TextBox>BOX</TextBox>
        <TextBlock>block</TextBlock>   
    </Grid>

The words block and BOX are written over eacht other and no keyboard input is possible in the textbox.

Now consider this:

<Grid>
   <TextBlock>block<TextBlock/>
   <TextBox>BOX<TextBox/>
</Grid>

The TextBox covers the TextBlock entirely and works as expected.

But say that I would like to be able to type in the textbox, while the content of the texblock remains visible (in a UserControl for instance). Is this possible?

+2  A: 

This should do it:

<Grid>
    <TextBox>BOX</TextBox>
    <TextBlock IsHitTestVisible="False">block</TextBlock>   
</Grid>

HTH, Kent

Kent Boogaart
It did do it...;-)
Dabblernl