views:

18

answers:

1

Hello, I have following situation

<stackpanel >
  <ViewBox height=25/ >
  <tabcontrol>
     <tabitem>
        <Canvas />
     </tabitem>
   </tabcontrol>
</stackpanel>

Q1. I want stackpanel to fill the screen, tabcontrol to fill the remain portion after viewbox. How do I do that ? How do I avoid the tabcontrol shrinking based on the size of tab items. Q2. I want the canvas restricted to the tabitem size. Currently I put anything in the canvas and scorll it goes beyond the tab item. Any idea how to control this.

A: 

This is how Canvas works - it does not participate in the measure and arrange pass like Grid and StackPanel.

Please consider using a Grid instead.

Jeff Wilcox