All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net初学者:petshop4.0设计说明_.net资料_编程技术
不用组件实现Ajax效果_[AJAX教程]
事半功倍之javascript(2)_JavaScript技术_编程技术
ASP.NET查询ACCESS数据库的内容并在DATAVIEW中显示出来_.net资料_编程技术
C#文件处理技术:判断文件是否存在
gridview超出长度用..代替,提示显示详细信息_[Asp.Net教程]
配置整合Win+Apache+PHP+MySQL+Tcomcat(或Resin)完全手册_[PHP教程]
ASP.NET技巧:使用Gridview绑定数据库中的图片_[Asp.Net教程]
简单学习动态网页制作PHP中的Cookies_php资料_编程技术
动态网页PHP编程中八种常见的文件操作方式_[PHP教程]
Reading number is top 10 pictures
中国的十元人民币的秘密
黑社会大哥相亲
运动的范冰冰1
红楼梦金陵十二钗(2)
The Soviet union swimsuit exposure in the 70 year3
The money of more than 100 countries and regions1
10 powerless things in life
Wild animals melee moment of life and death1
9.3阅兵全景图2-英雄连队梯队和外国方阵梯队
玩手机对身体不好
Download software ranking
仙剑奇侠传98版歌曲
jdk1.5
Unix video tutorial2
电车之狼R
Unix video tutorial18
打鸟视频
功夫熊猫2(下集)
I'm come from Beijing2
Boxer's Top ten classic battle8
美女写真1
qq published in(发表于) 2014/7/11 9:18:03 Edit(编辑)
C#中SplitContainer控件应用实例

C#中SplitContainer控件应用实例

C#中SplitContainer控件应用实例

SplitContainer控件

功能

SplitContainer控件被看作是一个复合体,它是由一个可移动的拆分条分隔的两个面板。当鼠标指针悬停在该拆分条上时,指针将相应地呈现为灰度校正状,以显示该拆分条是可移动的。图1所示为SplitContainer控件。



图1 SplitContainer控件

2.属性

SplitContainer控件常用属性及说明如表1所示。



表1 SplitContainer控件常用属性及说明

下面详细介绍Orientation属性,该属性用于确定拆分器的方向,而不是确定控件自身的方向。

语法:

public Orientation Orientation { get; set; }

属性值:Orientation值之一。默认为Vertical。Orientation指定控件或控件元素的方向。当值为Horizontal时,水平放置控件或元素;当值为Verticalt时,垂直放置控件或元素,默认为此选项。

示例

Orientation属性的使用

本示例中,当程序运行时,单击【Orientation属性】按钮,设置Orientation属性为Horizontal,使控件水平排列。网站源代码示例运行结果如图2所示。



Orientation属性

程序主要代码如下:

private void button1_Click(object sender, EventArgs e)

{

this.splitContainer1.Orientation= Orientation.Horizontal;

}

完整程序代码如下:

★★★★★主程序文件完整程序代码★★★★★

using System;

using System.Collections.Generic;

using System.Windows.Forms;

namespace _8_21

{

static class Program

{

///

本教程来自http://www.isstudy.com/

/// 应用程序的主入口点。

///


[STAThread]

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new frmSplitContainer());

}

}

}

★★★★★frmSplitContainer窗体设计文件完整程序代码★★★★★

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace _8_21

{

public partial class frmSplitContainer : Form

{

public frmSplitContainer()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

this.splitContainer1.Orientation= Orientation.Horizontal;

}

private void button2_Click(object sender, EventArgs e)

{

this.splitContainer1.FixedPanel = FixedPanel.Panel1;

}

private void button3_Click(object sender, EventArgs e)

{

Application.Exit();

}

private void frmSplitContainer_Load(object sender, EventArgs e)

{

}

}

}

★★★★frmSplitContainer窗体代码文件完整程序代码★★★★★

namespace _8_21

{

partial class frmSplitContainer

{

/// 本教程来自http://www.isstudy.com/

/// 必需的设计器变量。

///


private System.ComponentModel.IContainer components = null;

///

/// 清理所有正在使用的资源。

///


/// 如果应释放托管资源,为 true;否则为 false。

protected override void Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

base.Dispose(disposing);

}

#region Windows 窗体设计器生成的代码

///

/// 设计器支持所需的方法 - 不要

/// 使用代码编辑器修改此方法的内容。网站源代码

///


private void InitializeComponent()

{

this.splitContainer1 = new System.Windows.Forms.SplitContainer();

this.button1 = new System.Windows.Forms.Button();

this.button4 = new System.Windows.Forms.Button();

this.button3 = new System.Windows.Forms.Button();

this.button2 = new System.Windows.Forms.Button();

this.splitContainer1.Panel1.SuspendLayout();

this.splitContainer1.Panel2.SuspendLayout();

this.splitContainer1.SuspendLayout();


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.