1

I have the following XAML code:

<TabItem Header="Hey there, handsome!">
    <Canvas>
      <GroupBox Header="30" Canvas.Top="40">
        <Canvas>
          <Label Canvas.Top="40">dawd</Label>
        </Canvas>
      </GroupBox>
    </Canvas>
</TabItem>

I expect to see a GroupBox that is 40px from the top of the tab and inside the GroupBox a label that is 40px from its top.

But this happens:

enter image description here

What am I doing wrong and how can I solve it?

(All in all, I just need a layout panel for absolute positioning).

Community
  • 1
  • 1
Gilad Naaman
  • 6,390
  • 15
  • 52
  • 82
  • 1
    This might be your problem: http://stackoverflow.com/questions/855334/wpf-how-to-make-canvas-auto-resize – Chris Jun 30 '13 at 12:25

1 Answers1

3

I think this a Canvas behaviour, with Grid instead of Canvas that should work fine, and why not set the GroupBox Height and Width property to "Auto" ?