`
qqchinaok
  • 浏览: 218294 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
阅读更多
    先通过在ide中拉出这样的效果图 以学习相关属性上面效果的相关代码code<!--<br /><br />code highlighting produced by actipro codehighlighter (freeware)<br />http://www.codehighlighter.com/<br /><br />-->#regionwindows窗体设计器生成的代码///<summary>///设计器支持所需的方法-不要///使用代码编辑器修改此方法的内容。///</summary>privatevoidinitializecomponent(){this.tablelayoutpanel1=newsystem.windows.forms.tablelayoutpanel();this.button1=newsystem.windows.forms.button();this.button2=newsystem.windows.forms.button();this.button3=newsystem.windows.forms.button();this.button4=newsystem.windows.forms.button();this.button5=newsystem.windows.forms.button();this.button6=newsystem.windows.forms.button();this.tablelayoutpanel1.suspendlayout();this.suspendlayout();////tablelayoutpanel1//this.tablelayoutpanel1.cellborderstyle=system.windows.forms.tablelayoutpanelcellborderstyle.single;this.tablelayoutpanel1.columncount=2;this.tablelayoutpanel1.columnstyles.add(newsystem.windows.forms.columnstyle(system.windows.forms.sizetype.percent,50f));this.tablelayoutpanel1.columnstyles.add(newsystem.windows.forms.columnstyle(system.windows.forms.sizetype.percent,50f));this.tablelayoutpanel1.controls.add(this.button1,0,0);this.tablelayoutpanel1.controls.add(this.button2,1,0);this.tablelayoutpanel1.controls.add(this.button3,1,1);this.tablelayoutpanel1.controls.add(this.button4,0,2);this.tablelayoutpanel1.controls.add(this.button5,0,3);this.tablelayoutpanel1.controls.add(this.button6,1,2);this.tablelayoutpanel1.location=newsystem.drawing.point(46,35);this.tablelayoutpanel1.name="tablelayoutpanel1";this.tablelayoutpanel1.rowcount=5;this.tablelayoutpanel1.rowstyles.add(newsystem.windows.forms.rowstyle(system.windows.forms.sizetype.percent,25f));this.tablelayoutpanel1.rowstyles.add(newsystem.windows.forms.rowstyle(system.windows.forms.sizetype.percent,25f));this.tablelayoutpanel1.rowstyles.add(newsystem.windows.forms.rowstyle(system.windows.forms.sizetype.percent,25f));this.tablelayoutpanel1.rowstyles.add(newsystem.windows.forms.rowstyle(system.windows.forms.sizetype.percent,25f));this.tablelayoutpanel1.rowstyles.add(newsystem.windows.forms.rowstyle(system.windows.forms.sizetype.absolute,20f));this.tablelayoutpanel1.size=newsystem.drawing.size(200,195);this.tablelayoutpanel1.tabindex=1;////button1//this.button1.location=newsystem.drawing.point(4,4);this.button1.name="button1";this.tablelayoutpanel1.setrowspan(this.button1,2);this.button1.size=newsystem.drawing.size(75,79);this.button1.tabindex=0;this.button1.text="button1";this.button1.usevisualstylebackcolor=true;////button2//this.button2.location=newsystem.drawing.point(103,4);this.button2.name="button2";this.button2.size=newsystem.drawing.size(75,23);this.button2.tabindex=1;this.button2.text="button2";this.button2.usevisualstylebackcolor=true;////button3//this.button3.anchor=system.windows.forms.anchorstyles.none;this.button3.location=newsystem.drawing.point(112,53);this.button3.name="button3";this.button3.size=newsystem.drawing.size(75,23);this.button3.tabindex=2;this.button3.text="button3";this.button3.usevisualstylebackcolor=true;////button4//this.button4.anchor=((system.windows.forms.anchorstyles)((((system.windows.forms.anchorstyles.top|system.windows.forms.anchorstyles.bottom)|system.windows.forms.anchorstyles.left)|system.windows.forms.anchorstyles.right)));this.button4.location=newsystem.drawing.point(4,90);this.button4.name="button4";this.button4.size=newsystem.drawing.size(92,36);this.button4.tabindex=3;this.button4.text="button4";this.button4.usevisualstylebackcolor=true;////button5//this.button5.anchor=system.windows.forms.anchorstyles.none;this.button5.location=newsystem.drawing.point(12,139);this.button5.name="button5";this.button5.size=newsystem.drawing.size(75,23);this.button5.tabindex=4;this.button5.text="button5";this.button5.usevisualstylebackcolor=true;////button6//this.button6.location=newsystem.drawing.point(103,90);this.button6.name="button6";this.tablelayoutpanel1.setrowspan(this.button6,2);this.button6.size=newsystem.drawing.size(75,79);this.button6.tabindex=5;this.button6.text="button6";this.button6.usevisualstylebackcolor=true;////tablelayoutpanelform//this.autoscaledimensions=newsystem.drawing.sizef(6f,12f);this.autoscalemode=system.windows.forms.autoscalemode.font;this.clientsize=newsystem.drawing.size(292,265);this.controls.add(this.tablelayoutpanel1);this.name="tablelayoutpanelform";this.text="tablelayoutpanelform";this.tablelayoutpanel1.resumelayout(false);this.resumelayout(false);}#endregion
分享到:
评论

相关推荐

    c# tablelayoutpanel 动态增加和删除列 已测试通过 动态合并单元格 动态添加控件

    总之,`TableLayoutPanel`的动态管理能力使得开发者能够构建更灵活的用户界面,通过增加和删除列适应不同场景,通过合并单元格实现复杂布局,而动态添加控件则有助于根据程序运行时的需求创建或更新UI。这些都是C# ...

    winform tableLayoutPanel

    tableLayoutPanel: 表格布局面板,适合以表格形式规则的动态添加(显示)控件。使用方法概述:1.将 tableLayoutPanel 拖放到窗体指定区域 ——一般做些基本的设置 或添加行或列,其它的就需写代码来控制显示

    C#Winform界面布局设计(左侧菜单)右侧窗口操作

    总的来说,C# Winform界面布局设计涉及到控件的选择与配置、布局管理、事件处理等多个方面。通过熟练掌握这些知识点,开发者可以创建出用户友好、功能丰富的Windows桌面应用程序。在实际项目中,应结合业务需求,...

    C#WinForm学习实战项目

    在本文中,我们将深入探讨"C# WinForm学习实战项目",这是一个专为初学者设计的教程,涵盖了多种控件的基本使用。WinForm是.NET Framework中用于构建桌面应用程序的一个强大工具,它提供了丰富的用户界面组件,使得...

    C#Winform布局设计-右侧菜单模版

    在C# WinForm开发中,布局设计是创建用户友好、高效的应用程序的关键步骤。"C# Winform布局设计-右侧菜单模版" 提供了一种常见的界面设计方案,它将功能模块集中在左侧作为菜单,右侧区域则展示对应的功能窗口。这种...

    C#在panel动态添加控件

    本示例关注的是如何在C#中使用ASP.NET Web应用程序,在一个Panel控件上动态添加控件。这个过程对于创建可自定义、灵活且交互性强的用户界面非常有用。 首先,我们需要理解Panel控件。Panel在ASP.NET中是一个容器...

    C#winform制作绚丽的Ui界面

    1. 布局容器:WinForm提供了多种布局容器,如FlowLayoutPanel、TableLayoutPanel和StackPanel,它们可以帮助开发者方便地管理控件的位置和大小,实现响应式布局。 2. 设计工具:Visual Studio的Design View允许...

    C# winform也可以实现很好看的界面(源码)

    在布局设计上,使用`TableLayoutPanel`或`FlowLayoutPanel`可以帮助我们更好地组织控件,实现灵活的网格布局或流式布局。通过设置控件的Dock属性,可以使其填充容器的某一边或全部,达到现代应用常见的全屏布局效果...

    使用TableLayoutPanel(2.0)

    【TableLayoutPanel控件详解】 在C# WinForm应用开发中,`TableLayoutPanel`是一个非常重要的布局控件,它允许开发者创建复杂、灵活的网格布局。`TableLayoutPanel`控件是.NET Framework 2.0版本引入的新特性,为...

    C#WinForm基础学习笔记

    ### C# WinForm 基础学习笔记 #### 一、WinForm 概念与基本操作 **知识点:** 1. **定义与作用:** - **定义:** WinForm 是 .NET Framework 提供的一种用于创建 Windows 用户界面的工具集。 - **作用:** 可以...

    C#自定义控件之-winform美化

    使用TableLayoutPanel、FlowLayoutPanel等布局控件可以方便地排列和调整控件的位置。此外,自定义布局逻辑可以实现更复杂的布局需求。 7. **高DPI支持** 随着高分辨率屏幕的普及,确保WinForm应用在不同DPI环境下...

    C# WinForm 在Panel中添加Form 教程+源码

    在C# WinForm开发中,有时我们希望实现一种类似MDI(Multiple Document Interface)的界面效果,但又不满足于MDI的默认样式。这时,我们可以利用Panel控件来达到目的,实现更自定义化的界面设计。本教程将详细介绍...

    C#之模仿office界面布局程序框架winForm

    通过这个源码程序,开发者不仅可以学习到C# WinForm中的界面布局技巧,还能深入理解Ribbon控件的使用。同时,对于自定义控件、事件处理、数据绑定等方面的知识也有一定的提升。总的来说,这是一个很好的学习和实践...

    窗体控件自动布局(自动布局窗体中控件)

    该类可以帮大家自动布局界面控件,不需要开发人员每个控件的设置属性,只需要调用方法,自动会设置该控件的布局,并且控件的宽度随着窗体的变化而变化,该方法调用很简单 二.原理:使用TableLayOutPanle的功能,然后设定...

    C#winform分屏程序

    C# WinForm提供了多种布局管理器,如FlowLayoutPanel、TableLayoutPanel和SplitContainer等。SplitContainer控件是实现分屏效果的关键,它允许用户动态地调整两个或多个面板之间的边界。开发者可以通过设置...

    C#WinForm 198个经典实例源码(超赞),C#初学者神器

    以上知识点是C# WinForm开发中常见的技术点,每个实例都会结合具体场景进行深入讲解,对于学习和理解C# WinForm应用开发具有很大的帮助。通过这些实例,开发者不仅可以熟悉C#语法,还能掌握Windows桌面应用的开发...

    折叠面板(c# winform)

    可以使用`FlowLayoutPanel`或`TableLayoutPanel`控件代替`GroupBox`,它们提供了更灵活的自动布局功能,可以根据需要自动调整子控件的位置和大小。 5. **样式和动画**: 若要增加用户体验,可以考虑添加过渡动画,...

    160多个C#WinForm简单小例子

    在Visual Studio 2008中,C# WinForm开发主要依赖Windows Forms Designer,这是一个可视化的布局工具,允许开发者通过拖放控件并设置属性来构建UI。每个WinForm应用程序的核心是窗体(Form)类,它是用户界面的主要...

    WinForm页面布局 控件

    WinForm窗体本身就是一个布局容器,可以通过调整窗体属性(如AutoSizeMode、AutoScaleMode等)来控制窗体及其中控件的大小和位置。窗体还可以包含多个容器控件,实现更复杂的布局组合。 4. **面板布局(Panel)** ...

    QQ导航条c#winform

    C# WinForm提供了多种布局管理器,如FlowLayoutPanel、TableLayoutPanel等,可以根据需求选择合适的布局方式。 5. **图像处理**: QQ导航条通常会包含一些图标或图片,这需要使用C#的图像处理类,如Bitmap和...

Global site tag (gtag.js) - Google Analytics