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


C# Label.SuspendLayout方法代码示例

本文整理汇总了C#中System.Windows.Forms.Label.SuspendLayout方法的典型用法代码示例。如果您正苦于以下问题:C# Label.SuspendLayout方法的具体用法?C# Label.SuspendLayout怎么用?C# Label.SuspendLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Label的用法示例。


在下文中一共展示了Label.SuspendLayout方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AlterarTextoFonte

        protected void AlterarTextoFonte(Label label, string texto, int máximoCaracteresTexto)
        {
            if (texto.Length > máximoCaracteresTexto)
                texto = texto.Substring(0, máximoCaracteresTexto - 4) + " ...";

            label.SuspendLayout();
            label.Text = texto;
            AjustarTamanhoFonte(label);
            label.ResumeLayout();
        }
开发者ID:andrepontesmelo,项目名称:imjoias,代码行数:10,代码来源:ListaPessoasItemBusca.cs

示例2: AddProgressBarX

 public void AddProgressBarX(string title)
 {
     this.m_baseWnd.SuspendLayout();
     Label label = new Label();
     label.SuspendLayout();
     label.AutoSize = false;
     label.Text = title;
     using (Graphics graphics = Graphics.FromHwnd(label.Handle))
     {
         this.m_titleWidth = ((int) graphics.MeasureString(label.Text, this.m_Font).Width) + label.Margin.Size.Width;
     }
     label.Size = new Size(this.m_titleWidth, label.Font.Height);
     label.Location = new Point(this.m_baseWnd.Location.X + this.m_fromPt.X, (this.m_baseWnd.Location.Y + this.m_fromPt.Y) + (this.m_intervalBarH * this.m_ValuePair.Count));
     ProgressBarX rx = new ProgressBarX();
     rx.SuspendLayout();
     rx.Size = new Size(this.m_barWidth, 0x17);
     rx.Style = ProgressBarStyle.Continuous;
     rx.Location = new Point((label.Location.X + label.Width) + 10, label.Location.Y - ((rx.Height - label.Height) >> 1));
     Label label2 = new Label();
     label2.SuspendLayout();
     label2.AutoSize = true;
     label2.Size = new Size(50, label2.Font.Height);
     label2.Text = string.Empty;
     label2.Location = new Point((rx.Location.X + rx.Width) + 10, label.Location.Y);
     rx.TitleLable = label;
     rx.TextLable = label2;
     ValuePair item = new ValuePair();
     item.Key = title;
     item.Value = rx;
     this.m_ValuePair.Add(item);
     this.m_baseWnd.Controls.Add(rx);
     this.m_baseWnd.Controls.Add(label);
     this.m_baseWnd.Controls.Add(label2);
     this.AdjustWindow();
     label2.ResumeLayout();
     rx.ResumeLayout();
     label.ResumeLayout();
     this.m_baseWnd.ResumeLayout();
     this.m_baseWnd.PerformLayout();
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:40,代码来源:ProgressBarXManager.cs

示例3: Label

        public static Label Label(IXsdPart part, ToolTip tooltip = null)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(part.Name))
                {
                    throw new ArgumentNullException();
                }
                var label = new Label();
                label.SuspendLayout();
                label.ForeColor = System.Drawing.Color.Black;
                label.AutoSize = true;
                label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                label.Font = Methods.BaseFont;
                label.Size = new System.Drawing.Size(41, 13);
                label.Text = part.Name;
                label.Name = "l" + part.Name;

                if (tooltip != null)
                {
                    tooltip.SetToolTip(label, part.Documentation);
                }

                if (part.Name == "HeaderLabel")
                {
                    label.Visible = false;
                    label.Margin = new Padding(0, 0, 0, 10);
                }

                label.ResumeLayout();
                return label;
            }
            catch (Exception ex)
            {
                log.Debug(ex);
                return null;
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:38,代码来源:Controls.cs

示例4: InitializeComponents

        private void InitializeComponents()
        {
            nameLabel = new Label();
              pathLabel = new Label();
              nameTextBox = new TextBox();
              pathTextBox = new TextBox();
              okButton = new Button();
              cancelButton = new Button();

              this.SuspendLayout();
              nameLabel.SuspendLayout();
              pathLabel.SuspendLayout();
              nameTextBox.SuspendLayout();
              pathTextBox.SuspendLayout();
              okButton.SuspendLayout();
              cancelButton.SuspendLayout();

              nameLabel.Text = "Name";
              nameLabel.AutoSize = true;
              nameLabel.Location = new Point(3, 3);

              pathLabel.Text = "Path";
              pathLabel.AutoSize = true;
              pathLabel.Location = new Point(3, 30);

              nameTextBox.Size = new Size(250, 19);
              nameTextBox.Location = new Point(40, 2);
              nameTextBox.BorderStyle = BorderStyle.FixedSingle;

              pathTextBox.Size = new Size(250, 19);
              pathTextBox.Location = new Point(40, 29);
              pathTextBox.BorderStyle = BorderStyle.FixedSingle;

              okButton.Text = "OK";
              okButton.Size = new Size(75, 23);
              okButton.Location = new Point((300-75)/2, 60);
              okButton.FlatStyle = FlatStyle.Flat;
              okButton.Click += delegate {
            this.DialogResult = DialogResult.OK;
            this.Close();
              };

              cancelButton.Text = "Cancel";
              cancelButton.Size = new Size(75, 23);
              cancelButton.Location = new Point(215, 60);
              cancelButton.FlatStyle = FlatStyle.Flat;
              cancelButton.Click += delegate {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
              };

              this.Size = new Size(300, 120);
              this.FormBorderStyle = FormBorderStyle.FixedSingle;
              this.Text = "Jump target";
              this.Controls.AddRange(new Control[]{
            nameLabel,
            pathLabel,
            nameTextBox,
            pathTextBox,
            okButton,
            cancelButton
              });

              nameLabel.ResumeLayout(false);
              pathLabel.ResumeLayout(false);
              nameTextBox.ResumeLayout(false);
              pathTextBox.ResumeLayout(false);
              okButton.ResumeLayout(false);
              cancelButton.ResumeLayout(false);
              this.ResumeLayout(false);
              this.PerformLayout();
        }
开发者ID:hazychill,项目名称:oog,代码行数:72,代码来源:AddJumpForm.cs

示例5: OccursLabel

 public static Label OccursLabel(decimal maxCount)
 {
     try
     {
         var label = new Label();
         label.SuspendLayout();
         label.ForeColor = System.Drawing.Color.Black;
         label.AutoSize = true;
         label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
         label.Font = Methods.BaseFont;
         label.BackColor = System.Drawing.Color.FromArgb(255, 195, 194);
         label.Size = new System.Drawing.Size(41, 13);
         label.Text = "Maximum of entries " + maxCount + " allowed";
         label.Name = "OccursError";
         label.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
         label.Visible = true;
         label.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
         label.Location = new System.Drawing.Point(0, 0);
         label.ResumeLayout();
         return label;
     }
     catch (Exception ex)
     {
         return null;
     }
 }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:26,代码来源:Controls.cs

示例6: CreateLabel

        public Label CreateLabel(string text, int xLocation, int width = -1)
        {
            var label = new Label();
            label.SuspendLayout();
            label.AutoSize = false;
            label.AutoEllipsis = true;
            label.Text = text;
            label.Font = font;
            label.Size = new Size(width == -1 ? TextRenderer.MeasureText(label.Text, label.Font).Width : width, this.barHeight);
            label.Location = new Point(xLocation, 0);
            label.TextAlign = ContentAlignment.MiddleLeft; // TODO: this doesn't work when there are ellipsis
            label.ResumeLayout();

            return label;
        }
开发者ID:kocubinski,项目名称:windawesome,代码行数:15,代码来源:Bar.cs

示例7: NodeTargetContinuousUI

        public NodeTargetContinuousUI(NodeTargetContinuous node)
        {
            int x, y;
            x = y = 0;

            Def.PbBase.Controls.Add(this);
            this.components = new System.ComponentModel.Container();
            this.Selector = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.Selector.GripMargin = new System.Windows.Forms.Padding(2);
            this.Selector.SuspendLayout();
            this.SuspendLayout();
            //            this.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
            //            this.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;

            this.Node = node;
            LabelTop = new Label();
            LabelBottom = new Label();
            LabelTop.SuspendLayout();
            LabelBottom.SuspendLayout();
            Def.PbBase.Controls.Add(this.LabelTop);
            Def.PbBase.Controls.Add(this.LabelBottom);
            LabelTop.AutoSize = true;
            LabelBottom.AutoSize = true;
            this.viewdataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.manuallysplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.autosplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fullautogrowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.removeSubNodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.MouseHover += new System.EventHandler(grid_MouseHover);
            this.MouseLeave += new System.EventHandler(grid_MouseLeave);
            this.ContextMenuStrip = this.Selector;
            //
            // Selector
            //
            this.Selector.AllowDrop = true;
            this.Selector.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.viewdataToolStripMenuItem,
            this.manuallysplitToolStripMenuItem,
            this.autosplitToolStripMenuItem,
            this.fullautogrowToolStripMenuItem,
            this.removeSubNodesToolStripMenuItem});
            this.Selector.Location = new System.Drawing.Point(23, 61);
            this.Selector.Name = "Menu";
            this.Selector.Size = new System.Drawing.Size(133, 148);
            this.Selector.Visible = true;
            //
            // viewdataToolStripMenuItem
            //
            this.viewdataToolStripMenuItem.Name = "viewdataToolStripMenuItem";
            this.viewdataToolStripMenuItem.Text = "View data";
            this.viewdataToolStripMenuItem.Click += new System.EventHandler(this.viewdataToolStripMenuItem_Click);
            //
            // manuallysplitToolStripMenuItem
            //
            this.manuallysplitToolStripMenuItem.Name = "manuallysplitToolStripMenuItem";
            this.manuallysplitToolStripMenuItem.Text = "Manually split";
            this.manuallysplitToolStripMenuItem.Click += new System.EventHandler(this.manuallysplitToolStripMenuItem_Click);
            //
            // autosplitToolStripMenuItem
            //
            this.autosplitToolStripMenuItem.Name = "autosplitToolStripMenuItem";
            this.autosplitToolStripMenuItem.Text = "Auto split";
            this.autosplitToolStripMenuItem.Click += new System.EventHandler(this.autosplitToolStripMenuItem_Click);
            //
            // fullautogrowToolStripMenuItem
            //
            this.fullautogrowToolStripMenuItem.Name = "fullautogrowToolStripMenuItem";
            this.fullautogrowToolStripMenuItem.Text = "Full auto grow";
            this.fullautogrowToolStripMenuItem.Click += new System.EventHandler(this.fullautogrowToolStripMenuItem_Click);
            //
            // removeSubNodesToolStripMenuItem
            //
            this.removeSubNodesToolStripMenuItem.Name = "removeSubNodesToolStripMenuItem";
            this.removeSubNodesToolStripMenuItem.Text = "Remove subnodes";
            this.removeSubNodesToolStripMenuItem.Click += new System.EventHandler(this.removeSubNodesToolStripMenuItem_Click);

            DataGridViewCellStyle Style1 = new DataGridViewCellStyle();
            DataGridViewCellStyle Style2 = new DataGridViewCellStyle();
            C1 = new DataGridViewTextBoxColumn();
            C2 = new DataGridViewTextBoxColumn();
            AllowUserToAddRows = false;
            AllowUserToDeleteRows = false;
            AllowUserToOrderColumns = false;
            AllowUserToResizeColumns = false;
            AllowUserToResizeRows = false;
            Style1.Alignment = DataGridViewContentAlignment.TopLeft;
            Style1.WrapMode = DataGridViewTriState.False;
            AlternatingRowsDefaultCellStyle = Style1;
            CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            ClipboardCopyMode = DataGridViewClipboardCopyMode.Disable;
            Style2.Alignment = DataGridViewContentAlignment.TopLeft;
            Style2.BackColor = System.Drawing.SystemColors.Control;
            Style2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            Style2.ForeColor = System.Drawing.SystemColors.WindowText;
            Style2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            Style2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            Style2.WrapMode = DataGridViewTriState.True;
            ColumnHeadersDefaultCellStyle = Style2;
            ColumnHeadersVisible = false;
            Columns.Add(this.C1);
//.........这里部分代码省略.........
开发者ID:evandrojr,项目名称:TreeWorks,代码行数:101,代码来源:NodeTargetContinuousUI.cs


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