c# winform tablelayoutpanel学习 合并行的布局及动态增加删除内部控件

    先通过在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

你可能感兴趣的:(java,工作)