zoukankan      html  css  js  c++  java
  • WPF SDK研究 Intro(3) QuickStart3

    QuickStart3
        This sample shows you how to construct a complex Extensible Application Markup Language (XAML) layout by nesting TextBlock, Button, and DockPanels within a parent DockPanel.
        这个例子用来演示控件中可以任意的嵌入控件,效果图如下:


    xaml文档如下:
    <Page 
      xmlns
    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml">
      
    <DockPanel     
          xmlns
    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml">
        
    <TextBlock Background="LightBlue"
                    DockPanel.Dock
    ="Top">Some Text</TextBlock>
        
    <TextBlock DockPanel.Dock="Bottom"
                    Background
    ="LightYellow">Some text at the bottom of the page.</TextBlock>
        
    <TextBlock DockPanel.Dock="Left"
                    Background
    ="Lavender">Some More Text</TextBlock>
        
    <DockPanel Background="Bisque">
          
    <StackPanel DockPanel.Dock="Top">
            
    <Button HorizontalAlignment="Left" 
                    Height
    ="30px"
                    Width
    ="100px"
                    Margin
    ="10,10,10,10">Button1</Button>
            
    <Button HorizontalAlignment="Left"
                    Height
    ="30px"
                    Width
    ="100px"
                    Margin
    ="10,10,10,10">Button2</Button>
          
    </StackPanel>
          
    <TextBlock Background="LightGreen">Some Text Below the Buttons</TextBlock>
        
    </DockPanel>
      
    </DockPanel>
    </Page>

  • 相关阅读:
    【HNOI2016模拟4.14】B
    【NOIP2010提高组】引水入城
    【NOIP2010提高组】机器翻译
    【NOIP2010提高组】乌龟棋
    【NOIP2010提高组】关押罪犯
    【USACO题库】3.3.2 Shopping Offers商店购物
    【USACO题库】3.1.5 Contact联系
    【USACO题库】3.1.4 Shaping Regions形成的区域
    【USACO题库】3.1.3 Humble Numbers丑数
    c语言学习——printf格式规定符
  • 原文地址:https://www.cnblogs.com/Jax/p/1096743.html
Copyright © 2011-2022 走看看