kkh
kkh

Reputation: 4869

WPF overlap textblocks

Hi I have 3 textblocks in which when i click any of three buttons, one of the texblocks will show and the other 2 will hide. so far i can do the click and show the relative textblock, but the 3 textblocks do not show and hide at the same position? how do i position them at the same place?

Upvotes: 0

Views: 1829

Answers (2)

Vinit Sankhe
Vinit Sankhe

Reputation: 19885

Probably you are using Btn.Visibility="Hidden". Use Btn.Visibility="Collapsed".

Upvotes: 1

Matt Hamilton
Matt Hamilton

Reputation: 204129

Overlap them by throwing them all into the same grid:

<Grid>
    <TextBlock Name="text1" Text="First Text" />
    <TextBlock Name="text2" Text="Second Text" />
    <TextBlock Name="text3" Text="Third Text" />
</Grid>

Elements in the same row/column in a grid (0 by default, as in the example above) will overlap.

Upvotes: 0

Related Questions