本文整理汇总了C#中Panel.HasControls方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.HasControls方法的具体用法?C# Panel.HasControls怎么用?C# Panel.HasControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel.HasControls方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawPanelForSuccess
/// <summary>
/// Display success message
/// </summary>
/// <param name="panelParam">Panel to draw success message</param>
/// <param name="message">Message to display</param>
private void DrawPanelForSuccess(Panel panelParam, string message)
{
if (panelParam.HasControls())
{
panelParam.Controls.Clear();
}
Table table = new Table();
table.CssClass = "success";
table.Font.Name = "Sans-serif";
table.Font.Size = 9;
TableRow rowOne = new TableRow();
TableCell rowOneCellOne = new TableCell();
rowOneCellOne.Font.Bold = true;
rowOneCellOne.Text = "SUCCESS:";
rowOne.Controls.Add(rowOneCellOne);
table.Controls.Add(rowOne);
TableRow rowTwo = new TableRow();
TableCell rowTwoCellOne = new TableCell();
rowTwoCellOne.Text = "<b>Total Votes:</b>" + message;
rowTwo.Controls.Add(rowTwoCellOne);
table.Controls.Add(rowTwo);
panelParam.Controls.Add(table);
}
示例2: DrawPanelForSuccess
/// <summary>
/// Display success message
/// </summary>
/// <param name="panelParam">Panel to draw success message</param>
/// <param name="message">Message to display</param>
private void DrawPanelForSuccess(Panel panelParam, string message)
{
if (panelParam.HasControls())
{
panelParam.Controls.Clear();
}
Table table = new Table();
table.CssClass = "successWide";
table.Font.Name = "Sans-serif";
table.Font.Size = 9;
TableRow rowOne = new TableRow();
TableCell rowOneCellOne = new TableCell();
rowOneCellOne.Font.Bold = true;
rowOneCellOne.Text = "SUCCESS:";
rowOne.Controls.Add(rowOneCellOne);
table.Controls.Add(rowOne);
TableRow rowTwo = new TableRow();
TableCell rowTwoCellOne = new TableCell();
rowTwoCellOne.Font.Bold = true;
rowTwoCellOne.Text = "Message ID:";
rowTwoCellOne.Width = Unit.Pixel(70);
rowTwo.Controls.Add(rowTwoCellOne);
TableCell rowTwoCellTwo = new TableCell();
rowTwoCellTwo.Text = message.ToString();
rowTwo.Controls.Add(rowTwoCellTwo);
table.Controls.Add(rowTwo);
panelParam.Controls.Add(table);
}
示例3: DrawPanelForFailure
/// <summary>
/// Displays error message
/// </summary>
/// <param name="panelParam">Panel to draw success message</param>
/// <param name="message">Message to display</param>
private void DrawPanelForFailure(Panel panelParam, string message)
{
if (panelParam.HasControls())
{
panelParam.Controls.Clear();
}
Table table = new Table();
table.CssClass = "errorWide";
table.Font.Name = "Sans-serif";
table.Font.Size = 9;
TableRow rowOne = new TableRow();
TableCell rowOneCellOne = new TableCell();
rowOneCellOne.Font.Bold = true;
rowOneCellOne.Text = "ERROR:";
rowOne.Controls.Add(rowOneCellOne);
table.Controls.Add(rowOne);
TableRow rowTwo = new TableRow();
TableCell rowTwoCellOne = new TableCell();
rowTwoCellOne.Text = message.ToString();
rowTwo.Controls.Add(rowTwoCellOne);
table.Controls.Add(rowTwo);
panelParam.Controls.Add(table);
}
示例4: drawPanelForSuccess
/* This function is called to draw the table in the panelParam panel for success response */
private void drawPanelForSuccess(Panel panelParam, string message)
{
if (panelParam.HasControls())
{
panelParam.Controls.Remove(statusTable);
}
statusTable = new Table();
statusTable.Font.Name = "Sans-serif";
statusTable.Font.Size = 9;
statusTable.BorderStyle = BorderStyle.Outset;
statusTable.Width = Unit.Pixel(200);
TableRow rowOne = new TableRow();
TableCell rowOneCellOne = new TableCell();
rowOneCellOne.Font.Bold = true;
rowOneCellOne.Text = "SUCCESS:";
//rowOneCellOne.BorderWidth = 1;
rowOne.Controls.Add(rowOneCellOne);
statusTable.Controls.Add(rowOne);
TableRow rowTwo = new TableRow();
TableCell rowTwoCellOne = new TableCell();
rowTwoCellOne.Text = message.ToString();
//rowTwoCellOne.BorderWidth = 1;
rowTwo.Controls.Add(rowTwoCellOne);
statusTable.Controls.Add(rowTwo);
statusTable.BorderWidth = 2;
statusTable.BorderColor = Color.DarkGreen;
statusTable.BackColor = System.Drawing.ColorTranslator.FromHtml("#cfc");
panelParam.Controls.Add(statusTable);
}