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

Reading number is top 10 articles
Spring集成XFire开发WebService_.net资料_编程技术
使用ASP.NET制作功能完善的安装程序_.net资料_编程技术
学习PHP动态网页技术收集的几个有用函数_php资料_编程技术
新手学习用PHP程序对网页表单的处理_php资料_编程技术
如何在C#中播放AVI短片并使背景透明_[Asp.Net教程]
PHP生成静态HTML文章发布系统的思路_php资料_编程技术
.NET内置对象之Cache对象_[Asp.Net教程]
SQL Server 2008安装过程图解_[SQL Server教程]
smarty技术学习,修改php模板的一点体会_[PHP教程]
对DataGridView数据控件进行绑定应用实例
Reading number is top 10 pictures
美女和狗狗2
Sora aoi mirror memorial classics4
The world first motorcycle will be auctioned for 21000 pounds
囚犯暴乱了咋办?
Kim jong il's mistress, national beauty JinYuJi actor2
2012 national geographic daily picture5
真正的国产-非模拍 贵在是真实1
恶搞漫画2
The wise woman of chest1
西方气质的东方美女3
Download software ranking
Unix video tutorial9
Boxer's Top ten classic battle3
Tram sex maniac 2 (H) rar bag6
linux安装大全
美女游泳记
Kung.Fu.Panda.2
C#COM编程指南
White deer villiage
虚拟机5.5.3版
C++编程教程第三版
qq published in(发表于) 2014/7/11 9:16:22 Edit(编辑)
C#中FlowLayoutPanel控件用法以及实例

C#中FlowLayoutPanel控件用法以及实例

C#中FlowLayoutPanel控件用法以及实例

FlowLayoutPanel控件

功能

FlowLayoutPanel控件用来在水平或垂直方向排列其内容。开发人员可以将FlowLayoutPanel控件的内容从一行换至下一行,或者从一列换至下一列,还可以选择剪裁内容。任何Windows窗体控件都可以是FlowLayoutPanel控件的子控件,包括FlowLayout Panel的其他实例。利用此功能,可以在运行时构造适应窗体尺寸大小的复杂布局。图1所示为FlowLayoutPanel 控件。



图1 FlowLayoutPanel控件

2.属性

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



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

下面详细介绍FlowDirection属性,此属性用来指示控件布局的方向。

语法:

public FlowDirection FlowDirection { get; set; }

属性值:FlowDirection值之一,指示控件在面板中的连续放置方向。默认值为LeftToRight。

说明:FlowDirection是一个返回值,它用来指定控件布局的方向。当值为BottomUp时,元素从设计图面的底部流到顶部;当值为LeftToRight时,元素从设计图面的左边缘流到右边缘,默认为此选项;当值为RightToLeft时,元素从设计图面的右边缘流到左边缘;当值为TopDown时,元素从设计图面的顶部流到底部。本教程来自http://www.isstudy.com/

示例

FlowDirection属性

本示例中,当程序运行时,单击【FlowDirection属性】按钮,把FlowDirection属性设置为底部布局。示例运行结果如图2所示。



图2 FlowDirection属性

程序主要代码如下:

this.flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;

完整程序代码如下:网站源代码

主程序文件完整程序代码如下:

using System;

using System.Collections.Generic;

using System.Windows.Forms;

namespace _8_19

{

static class Program

{

///



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

///


[STAThread]

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.Run(new frmFlowLayoutPane());

}

}

}

frmFlowLayoutPane窗体设计文件完整程序代码如下:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace _8_19

{

public partial class frmFlowLayoutPane : Form

{

public frmFlowLayoutPane()

{

InitializeComponent();

}

private void button7_Click(object sender, EventArgs e)

{

this.flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;

}

private void button8_Click(object sender, EventArgs e)

{

this.flowLayoutPanel1.SetFlowBreak(this.flowLayoutPanel1, false);

}

private void flowLayoutPanel1_Layout(object sender, LayoutEventArgs e)

{

}

private void frmFlowLayoutPane_Load(object sender, EventArgs e)

{

}

}

}

frmFlowLayoutPane窗体代码文件完整程序代码如下:

namespace _8_19

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

{

partial class frmFlowLayoutPane

{

///

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

///


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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();

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

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


添加到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.