本文整理汇总了C#中System.Windows.Forms.Panel.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Update方法的具体用法?C# Panel.Update怎么用?C# Panel.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvalidateAndUpdate
private void InvalidateAndUpdate(Panel panel)
{
panel.Invalidate(true);
panel.Update();
}
示例2: TaskMediator
protected void TaskMediator(Panel stepPanel, TextBox stepLogTextBox, List<String> messages)
{
stepPanel.Update();
FlushMessages(messages, stepLogTextBox);
stepPanel.Update();
}
示例3: DisplayMenuItems
private Panel DisplayMenuItems()
{
int defaultSkipHeight = 10; // 10 px;
int defaultSkipWidth = 4;
int currentHeight = 4;
int currentIndexOf = 0;
List<Menu> MenuItems = new Database().GetAllMenus();
Panel pnl = new Panel();
pnl.AutoScroll = false;
pnl.AutoSize = true;
pnl.Width = 2000;
pnl.Height = 1000;
foreach (Menu m in MenuItems)
{
int currentWidth = 4;
Label lblItemID = new Label();
Label lblItemName = new Label();
Label lblItemPrice = new Label();
TextBox tbxAmmount = new TextBox();
Button btnRemove = new Button();
Button btnAdd = new Button();
lblItemID.Name = String.Format("lblItemID{0}", currentIndexOf.ToString());
lblItemName.Name = "lblItemName" + currentIndexOf.ToString();
lblItemPrice.Name = "lblItemPrice" + currentIndexOf.ToString();
tbxAmmount.Name = "tbxAmmount" + currentIndexOf.ToString();
btnRemove.Name = "btnRemove" + currentIndexOf.ToString();
btnAdd.Name = "btnAdd" + currentIndexOf.ToString();
lblItemID.Enabled = true;
lblItemName.Enabled = true;
lblItemPrice.Enabled = true;
tbxAmmount.Enabled = true;
btnRemove.Enabled = true;
btnAdd.Enabled = true;
lblItemID.AutoSize = true;
lblItemName.AutoSize = true;
lblItemPrice.AutoSize = true;
tbxAmmount.AutoSize = true;
btnRemove.AutoSize = true;
btnAdd.AutoSize = true;
lblItemID.Text = m.MenuID.Value.ToString();
lblItemName.Text = m.Entree + "\n" +
m.MainCourse + "\n" +
m.Dessert;
lblItemPrice.Text = m.Price.ToString();
tbxAmmount.Text = "0";
btnRemove.Text = "-";
btnAdd.Text = "+";
lblItemID.Location = new Point(currentWidth, currentHeight);
currentWidth += defaultSkipWidth + lblItemID.Width;
lblItemName.Location = new Point(currentWidth, currentHeight);
currentWidth += defaultSkipWidth + lblItemName.Width;
lblItemPrice.Location = new Point(currentWidth, currentHeight);
currentWidth += defaultSkipWidth + lblItemPrice.Width;
tbxAmmount.Location = new Point(currentWidth, currentHeight);
currentWidth += defaultSkipWidth + tbxAmmount.Width;
btnRemove.Location = new Point(currentWidth, currentHeight);
currentWidth += defaultSkipWidth + btnAdd.Width;
btnAdd.Location = new Point(currentWidth, currentHeight);
btnRemove.Click += new System.EventHandler(this.btnMenuItemsRemove_Click);
btnAdd.Click += new System.EventHandler(this.btnMenuItemsAdd_Click);
pnl.Controls.Add(lblItemID);
pnl.Controls.Add(lblItemName);
pnl.Controls.Add(lblItemPrice);
pnl.Controls.Add(tbxAmmount);
pnl.Controls.Add(btnRemove);
pnl.Controls.Add(btnAdd);
currentIndexOf++;
currentHeight += lblItemName.Size.Height + defaultSkipHeight;
}
pnl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
pnl.Update();
return pnl;
}
示例4: AgregarEvento
public void AgregarEvento(int iId, DateTime dFecha, string sTitulo, string sEvento)
{
var oEvento = Datos.GetEntity<ClienteEventoCalendario>(c => c.ClienteEventoCalendarioID == iId);
var oAdeudo = Datos.GetEntity<ClientesCreditoView>(c => c.ClienteID == oEvento.ClienteID);
var pnlEvento = new Panel();
pnlEvento.Tag = iId;
this.flpEventos.Controls.Add(pnlEvento);
Util.CopiarPropiedades(this.pnlMuestra, pnlEvento, "Visible");
foreach (Control oControl in this.pnlMuestra.Controls)
{
// Se crea el control nuevo
Control oNuevo = null;
if (oControl is DateTimePicker)
oNuevo = new DateTimePicker() { Name = "dtp" };
else if (oControl is Button)
oNuevo = new Button();
else if (oControl is Label)
oNuevo = new Label() { TextAlign = (oControl as Label).TextAlign };
// Se copian las propiedades de la base/muestra
Util.CopiarPropiedades(oControl, oNuevo, "Visible");
oNuevo.Name = oControl.Name;
// Se configuran los eventos para los controles especiales
if (oControl == this.btnRevisado)
{
oNuevo.Click += this.btnBien_Click;
}
else if (oControl == this.dtpFecha)
{
var dtp = (oNuevo as DateTimePicker);
dtp.Format = DateTimePickerFormat.Custom;
dtp.CustomFormat = "dd/MM/yyy hh:mm tt";
dtp.Checked = true;
dtp.Value = oEvento.Fecha;
dtp.ValueChanged += dtpFecha_ValueChanged;
}
else if (oControl == this.lblCambio)
{
oNuevo.Visible = false;
}
else if (oControl == this.lblCliente)
{
oNuevo.Text = oAdeudo.Nombre;
}
else if (oControl == this.lblVencido || oControl == this.lblAdeudo)
{
oNuevo.Text = (oControl == this.lblVencido ? oAdeudo.AdeudoVencido : oAdeudo.Adeudo).Valor().ToString(GlobalClass.FormatoMoneda);
}
else if (oControl == this.lblContacto)
{
oNuevo.Text = oAdeudo.CobranzaContacto;
}
// Se agrega al panel
pnlEvento.Controls.Add(oNuevo);
pnlEvento.Refresh();
pnlEvento.Update();
}
}