当前位置: 首页>>代码示例>>C#>>正文


C# Panel.Update方法代码示例

本文整理汇总了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();
 }
开发者ID:Drainyard,项目名称:LevelEditor,代码行数:5,代码来源:MainEditorWindow.HelperMethods.cs

示例2: TaskMediator

 protected void TaskMediator(Panel stepPanel, TextBox stepLogTextBox, List<String> messages)
 {
     stepPanel.Update();
       FlushMessages(messages, stepLogTextBox);
       stepPanel.Update();
 }
开发者ID:abibell,项目名称:mysql-workbench,代码行数:6,代码来源:WizardPluginPages.cs

示例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;
        }
开发者ID:forr,项目名称:BonTemps,代码行数:86,代码来源:FormMain.cs

示例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();
            }
        }
开发者ID:moisesiq,项目名称:aupaga,代码行数:62,代码来源:Eventos.cs


注:本文中的System.Windows.Forms.Panel.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。