曲沐阳吧 关注:3贴子:239
  • 2回复贴,共1

c# 关于TableLayoutPanel的问题:如何在一个表格里放两个控件

只看楼主收藏回复

RT


IP属地:北京1楼2011-05-27 09:23回复
    至今还未解决,无奈只能多增加一列,其他行的控件就要跨2列了~
    部分代码:
                 //Get the culture property of the thread.
                 CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
                 //Create TextInfo object.
                 TextInfo textInfo = cultureInfo.TextInfo;
                 //名称
                 Label nameLb = new Label();
                 nameLb.Name = Tag_Name;
                 nameLb.Text = textInfo.ToTitleCase(Tag_Name);
                 nameLb.Anchor = (AnchorStyles)(AnchorStyles.Right);
                 TextBox nameBox = new TextBox();
                 nameBox.Name = Tag_Name;
                 tlp.SetColumnSpan(nameBox, 2);
                 nameBox.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right);
                 //更新日期
                 Label modityDateLb = new Label();
                 modityDateLb.Name = Tag_ModifyDate;
                 modityDateLb.Text = textInfo.ToTitleCase(Tag_ModifyDate);
                 modityDateLb.Anchor = (AnchorStyles)(AnchorStyles.Right);
                 DateTimePicker dtp = new DateTimePicker();
                 tlp.SetColumnSpan(dtp,2);
                 tlp.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right);
                 //描述
                 Label descLb = new Label();
                 descLb.Name = Tag_Description;
                 descLb.Text = textInfo.ToTitleCase(Tag_Description);
                 descLb.Anchor = (AnchorStyles)(AnchorStyles.Right);
                 TextBox descBox = new TextBox();
    


    IP属地:北京2楼2011-05-27 16:59
    回复
                   descBox.Name = Tag_Description;
                   tlp.SetColumnSpan(descBox, 2);
                   descBox.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right);
                   //版本
                   Label versionLb = new Label();
                   versionLb.Name = Tag_Version;
                   versionLb.Text = textInfo.ToTitleCase(Tag_Version);
                   versionLb.Anchor = (AnchorStyles)(AnchorStyles.Right);
                   TextBox versionBox = new TextBox();
                   versionBox.Name = Tag_Version;
                   tlp.SetColumnSpan(versionBox, 2);
                   versionBox.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right);
                   //子流程
                   Label subflowLb = new Label();
                   subflowLb.Name = Tag_SubFlows;
                   subflowLb.Text = textInfo.ToTitleCase(Tag_SubFlows);
                   subflowLb.Anchor = (AnchorStyles)(AnchorStyles.Right);
                   TextBox subflowBox = new TextBox();
                   subflowBox.Name = Tag_SubFlows;
                   subflowBox.Text = "(**)";
                   subflowBox.Anchor=(AnchorStyles)(AnchorStyles.Left|AnchorStyles.Right);
                   Button subflowButton = new Button();
                   subflowButton.Text = "...";
                   subflowButton.Anchor = (AnchorStyles)(AnchorStyles.None);


      IP属地:北京3楼2011-05-27 16:59
      回复