当前位置: 首页 > news >正文

做商城网站需要在北京注册公司吗百度网盘24小时人工电话

做商城网站需要在北京注册公司吗,百度网盘24小时人工电话,中国设计人才网,小学门户网站建设情况汇报StackPanel StackPanel 是一种常用的布局控件,可以支持水平或垂直排列,但不会换行。当子元素添加到 StackPanel 中时,它们将按照添加的顺序依次排列。默认情况下,StackPanel 的排列方向是垂直的,即子元素将从上到下依次排列。可以使用 Orientation 属性更改排列方向。可以…

StackPanel

StackPanel 是一种常用的布局控件,可以支持水平或垂直排列,但不会换行。当子元素添加到 StackPanel 中时,它们将按照添加的顺序依次排列。默认情况下,StackPanel 的排列方向是垂直的,即子元素将从上到下依次排列。可以使用 Orientation 属性更改排列方向。可以设置两种排列方式:横排(Horizontal)和竖排(Vertical,默认)。水平排列时,每个元素都与面板一样高;垂直排列时,每个元素都与面板一样宽。

StackPanel 的Orientation属性

1.默认情况下Orientation="Vertical",<StackPanel Orientation="Vertical">与下方加粗字体是同一个效果 

// StackPanel 里添加了4个按钮,默认布局,Orientation 默认垂直排列
<Window x:Class="WpfFirstApp.StackPanelWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfFirstApp"
        mc:Ignorable="d"
        Title="StackPanelWindow" Height="450" Width="800">
    <StackPanel >
        <Button Content="按钮1"></Button>
        <Button Content="按钮2"></Button>
        <Button Content="按钮3"></Button>
        <Button Content="按钮4"></Button>
    </StackPanel>
</Window>

效果图:

也可不在xaml中增加button,改用代码增加;效果是一样的,C#中代码如下:

// 使用C# 代码直接实现
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfFirstApp
{
    /// <summary>
    /// StackPanelWindow.xaml 的交互逻辑
    /// </summary>
    public partial class StackPanelWindow : Window
    {
        public StackPanelWindow()
        {
            InitializeComponent();
            this.Title = "StackPanel面板";
            // StackPanel 默认排列
            StackPanel stackPanel = new StackPanel();
            this.Content = stackPanel;
            stackPanel.Children.Add(new Button(){Content="按钮1"});
            stackPanel.Children.Add(new Button(){Content = "按钮2"});
            stackPanel.Children.Add(new Button(){Content = "按钮3"});
            stackPanel.Children.Add(new Button(){Content = "按钮4"});
        }
    }
}

2.设置StackPanel的Orientation为横向(Horizontal)排列

// 设置 Orientation 属性(Horizontal)
<Window x:Class="WpfFirstApp.StackPanelWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfFirstApp"
        mc:Ignorable="d"
        Title="StackPanelWindow" Height="450" Width="800">
    <StackPanel Orientation="Horizontal">
        <Button Content="按钮1"></Button>
        <Button Content="按钮2"></Button>
        <Button Content="按钮3"></Button>
        <Button Content="按钮4"></Button>
    </StackPanel>
</Window>

效果图:

也可不在xaml中增加button,改用代码增加;效果是一样的,C#中代码如下:

// 使用C# 代码直接实现
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfFirstApp
{
    /// <summary>
    /// StackPanelWindow.xaml 的交互逻辑
    /// </summary>
    public partial class StackPanelWindow : Window
    {
        public StackPanelWindow()
        {
            InitializeComponent();
            this.Title = "StackPanel面板";
            // StackPanel 默认排列
            StackPanel stackPanel = new StackPanel();

            stackPanel.Orientation = Orientation.Horizontal;
            this.Content = stackPanel;
            stackPanel.Children.Add(new Button(){Content="按钮1"});
            stackPanel.Chil

http://www.mnyf.cn/news/51416.html

相关文章:

  • 招聘网站内容建设南昌seo方案
  • 自己做的网站显示不出来源码网站
  • 使用java做直播网站有哪些成功的网络营销案例
  • 怎么做类似返利网的网站产品推广营销
  • 哪个网站好chrome手机安卓版
  • 制作的大型网站多少钱公司关键词seo
  • 南方科技大学网站建设西安分类信息seo公司
  • 国内做网站个人网站免费域名注册
  • 安徽动漫公司 网站制作 安徽网新高端企业建站公司
  • wordpress编辑页面改字体颜色优化师和运营区别
  • 一站式网站搭建百度自动点击器
  • 中国做外贸的网站有哪些关键词首页排名优化
  • 个人网站怎么做微信支付优化大师app下载安装
  • 一级做爰片a视频网站试看关键词seo排名优化推荐
  • 做网站的安全证书做网站需要什么条件
  • 给人做违法网站规避ip网站查询服务器
  • 公司网站的开发和网版的重要性桂平seo快速优化软件
  • 昆明旅游网站建设百度投诉热线中心客服
  • 佛山做网站制作公司友情链接交换的作用在于
  • 电脑怎么做网站建个网站费用大概多少钱一年
  • 关于建设公司网站的申请百度知道怎么赚钱
  • 网站备案跟域名备案西安百度关键词优化排名
  • 龙岩百度推广太原seo公司
  • 成都有哪些网站建设电脑优化软件哪个好用
  • 自己做网站用什么软件下载站长之家域名查询排行
  • 济宁市中网站建设seo和点击付费的区别
  • 怎么在百度上做网站网站后端开发
  • 一个微信网站多少钱抚顺网站seo
  • 做网站容易找工作吗二十四个关键词
  • 潍坊网站建设维护天津百度网站排名优化