本文整理汇总了C#中System.Windows.Forms.FlowLayoutPanel.add_Control方法的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutPanel.add_Control方法的具体用法?C# FlowLayoutPanel.add_Control怎么用?C# FlowLayoutPanel.add_Control使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.FlowLayoutPanel
的用法示例。
在下文中一共展示了FlowLayoutPanel.add_Control方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addResultToFlowLayoutPanel
public static void addResultToFlowLayoutPanel(FlowLayoutPanel flowLayoutPanel, object returnData, Color color)
{
/*var result = new Panel
{
BackColor = color,
Height = 10,
Text = ((returnData != null) ? returnData.ToString() : "")
};*/
//flowLayoutPanel.ts_AddControl(result);
//if (returnData != null)
//{
var textBox = new TextBox
{
Width =
(flowLayoutPanel.Width > 20) ? flowLayoutPanel.Width - 22 : flowLayoutPanel.Width,
// 6 works except when there are scrool bars,
WordWrap = false,
Multiline = true,
BackColor = color,
ScrollBars = ScrollBars.None
};
var heigthItem = 14;
var heigthPad = 4;
if (returnData == null)
{
textBox.Text = ""; //"[null]";
}
else if (returnData is List<string>)
{
var stringList = (List<string>) returnData;
textBox.Lines = stringList.ToArray();
textBox.Height = heigthItem*stringList.Count + heigthPad;
}
else
{
var rawText = returnData.ToString();
var splittedText = rawText.Split(new[] {Environment.NewLine},
StringSplitOptions.RemoveEmptyEntries);
if (splittedText.Length == 0)
textBox.Text = "";
else
{
textBox.Lines = splittedText;
textBox.Height = heigthItem*splittedText.Length + heigthPad;
}
}
//Text =
// textBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
flowLayoutPanel.add_Control(textBox);
// }
// flowLayoutPanel.Controls.Add(okPanel);
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:59,代码来源:UnitTestExecutionViewHelpers.cs