开发者

stack panel and grid

originally i have just a pure grid control with butto开发者_运维知识库ns, checkboxes and textboxes. I wish to implement a tab control in my application, i added a tab control and added a stack panel for the children. What i see at the output is nothing but blank. Please advice me.. thanks!

example of original code:

<Grid Width="1185" Height="945" Background="Snow">
<Button Height="23" HorizontalAlignment="Right" Margin="0,133,56,0" Name="commonssnamemodifyButton" VerticalAlignment="Top" Visibility="Hidden" Width="67" Click="commonssnamemodifyButton_Click">Modify</Button>
<Button Height="23" HorizontalAlignment="Right" Margin="0,72,56,0" Name="mobilessnamemodifyButton" VerticalAlignment="Top" Width="67" Visibility="Hidden" Click="mobilessnamemodifyButton_Click">Modify</Button>
<Label Margin="588,205,497,0" Name="resultLabel" Visibility="Hidden" Height="23" VerticalAlignment="Top"></Label>
</Grid>

modified code:

<Grid Width="1185" Height="945" Background="Snow">
   <TabControl Margin=" 5">
            <TabItem Header="Properties">
                <StackPanel>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,133,56,0" Name="commonssnamemodifyButton" VerticalAlignment="Top" Visibility="Hidden" Width="67" Click="commonssnamemodifyButton_Click">Modify</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,72,56,0" Name="mobilessnamemodifyButton" VerticalAlignment="Top" Width="67" Visibility="Hidden" Click="mobilessnamemodifyButton_Click">Modify</Button>
                    <Label Margin="588,205,497,0" Name="resultLabel" Visibility="Hidden" Height="23" VerticalAlignment="Top"></Label>
                </StackPanel>
            </TabItem>
            <TabItem Header ="Output">
            </TabItem>
   </TabControl>
</Grid>


Oh i tried it, i placed grid control under TabItem, something like this and it worked:

   <TabControl Margin=" 5">
            <TabItem Header="Properties">
                <Grid Width="1185" Height="945" Background="Snow">
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,133,56,0" Name="commonssnamemodifyButton" VerticalAlignment="Top" Visibility="Hidden" Width="67" Click="commonssnamemodifyButton_Click">Modify</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,72,56,0" Name="mobilessnamemodifyButton" VerticalAlignment="Top" Width="67" Visibility="Hidden" Click="mobilessnamemodifyButton_Click">Modify</Button>
                    <Label Margin="588,205,497,0" Name="resultLabel" Visibility="Hidden" Height="23" VerticalAlignment="Top"></Label>
                </Grid>
            </TabItem>
            <TabItem Header ="Output">
            </TabItem>
   </TabControl>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜