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


C# Label.SendToBack方法代码示例

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


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

示例1: AddMaleApparels

        //Adding all male apparels information into their respective category(tabPage)
        private void AddMaleApparels()
        {
            foreach (TabPage tp in MCatalogue.TabPages)
            {
                tp.BackColor = Color.White;

                FlowLayoutPanel flp = new FlowLayoutPanel();
                flp.Dock = DockStyle.Fill;
                flp.AutoScroll = true;
                flp.VerticalScroll.Visible = true;
                flp.BackColor = Color.White;

                foreach (Apparel apparel in store.Apparels)
                {
                    if (apparel.Gender == 'M' && MCatalogue.TabPages.IndexOf(tp) == (apparel.Category.CategoryID - 1))
                    {
                        //Panel for each product
                        Panel panel = new Panel();
                        panel.Size = new Size(170, 270);
                        panel.BackColor = Color.White;
                        panel.BorderStyle = BorderStyle.FixedSingle;

                        //PictureBox for each product's image
                        PictureBox pb = new PictureBox();
                        pb.Location = new Point(9, 0);
                        pb.Size = new Size(150, 150);
                        pb.ImageLocation = "images/" + apparel.ImagePath;
                        pb.SizeMode = PictureBoxSizeMode.StretchImage;

                        //Label for the product's Description
                        Label productDescriptionLabel = new Label();
                        productDescriptionLabel.Location = new Point(0, 140);
                        productDescriptionLabel.Size = new Size(170, 40);
                        productDescriptionLabel.BackColor = Color.Transparent;
                        productDescriptionLabel.Text = apparel.Description;
                        productDescriptionLabel.TextAlign = ContentAlignment.MiddleLeft;
                        productDescriptionLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

                        //Label for the product's price
                        Label priceLabel = new Label();
                        priceLabel.Location = new Point(0, 180);
                        priceLabel.Size = new Size(170, 22);
                        priceLabel.BackColor = Color.Transparent;
                        productDescriptionLabel.TextAlign = ContentAlignment.MiddleLeft;
                        priceLabel.Text = "Price: " + apparel.Price.ToString("C", CultureInfo.CreateSpecificCulture("en-US"));
                        priceLabel.Font = new System.Drawing.Font("Arial", 8.4F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

                        //Label to display text "Size: "
                        Label sizeLabel = new Label();
                        sizeLabel.Location = new Point(0, 207);
                        sizeLabel.Size = new Size(41, 16);
                        sizeLabel.BackColor = Color.Transparent;
                        sizeLabel.Text = "Size:";
                        sizeLabel.Font = new System.Drawing.Font("Arial", 8.4F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                        sizeLabel.SendToBack();

                        //ComboxBox for user to select the size of the apparel
                        ComboBox sizeSelector = new ComboBox();
                        sizeSelector.Location = new Point(41, 205);
                        sizeSelector.Size = new Size(50, 80);
                        sizeSelector.Text = "size";
                        string[] possibleSize = { "XS", "S", "M", "L", "XL" };
                        foreach (string size in possibleSize)
                        {
                            sizeSelector.Items.Add(size);
                        }
                        sizeSelector.SelectedValueChanged += UpdateProductSize;
                        sizeSelector.Tag = apparel;
                        sizeSelector.BringToFront();

                        //Label to display the text "Quantity: "
                        Label quantityLabel = new Label();
                        quantityLabel.Location = new Point(90, 207);
                        quantityLabel.Size = new Size(35, 16);
                        quantityLabel.BackColor = Color.Transparent;
                        quantityLabel.Text = "Qty:";
                        quantityLabel.Font = new System.Drawing.Font("Arial", 8.4F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                        quantityLabel.SendToBack();

                        //NumericUpDown for user to select the quantity of the apparel
                        NumericUpDown quantitySelector = new NumericUpDown();
                        quantitySelector.Location = new Point(125, 205);
                        quantitySelector.Size = new Size(40, 30);
                        quantitySelector.TextAlign = HorizontalAlignment.Right;
                        quantitySelector.ReadOnly = true;
                        quantitySelector.Maximum = 5;
                        quantitySelector.Minimum = 0;
                        quantitySelector.ValueChanged += UpdateProductQuantity;
                        quantitySelector.Tag = apparel;
                        quantitySelector.BringToFront();

                        //Button for adding the product into the cart
                        Button b = new Button();
                        b.Location = new Point(19, 235);
                        b.Size = new Size(130, 30);
                        b.BackColor = System.Drawing.Color.Transparent;
                        b.FlatStyle = FlatStyle.Flat;
                        b.FlatAppearance.BorderColor = Color.Black;
                        b.FlatAppearance.BorderSize = 2;
//.........这里部分代码省略.........
开发者ID:alamsah2,项目名称:Prototype_Alam,代码行数:101,代码来源:POS.cs

示例2: CreateMidiEventDemoButton

        private void CreateMidiEventDemoButton(int x, int y, int i)
        {
            Label label = new Label();
            label.ForeColor = System.Drawing.Color.RoyalBlue;
            label.Location = new System.Drawing.Point(x + 1, y + 4);
            label.Size = new System.Drawing.Size(26, 14);
            label.Text = "rest";

            this.Controls.Add(label);
            _restLabels.Add(label);
            label.SendToBack();

            Button b = new Button();
            b.Location = new System.Drawing.Point(x, y);
            b.Size = new System.Drawing.Size(27, 24);
            //b.TabIndex = 82 + i;
            b.Text = (i + 1).ToString();
            b.UseVisualStyleBackColor = true;

            b.Click += new EventHandler(MidiEventDemoButton_Click);

            this.Controls.Add(b);
            _midiEventDemoButtons.Add(b);
            b.BringToFront();
        }
开发者ID:suvjunmd,项目名称:Moritz,代码行数:25,代码来源:PaletteButtonsControl.cs

示例3: CreateControls

        private void CreateControls()
        {
            #region Fields Creation
            foreach (var item in _editableItem.GetType().GetProperties())
            {
                bool standard = false;
                bool generic = false;
                bool array = false;

                //--Standard type
                if (TypesHelper.IsStandardType(item.PropertyType))
                {
                    if (item.PropertyType != typeof(bool))
                    {
                        Label lb = new Label();
                        lb.Text = item.Name + ":";
                        lb.Top = (this.Controls.Count * lb.Height);
                        lb.Left = 2;
                        lb.AutoSize = true;
                        lb.SendToBack();
                        this.Controls.Add(lb);
                        TextBox tb = new TextBox();
                        tb.Top = (this.Controls.Count * tb.Height);
                        tb.Left = 2;
                        tb.Name = string.Format("{0}_{1}", item.Name, "TextBox");
                        this.Controls.Add(tb);
                        _controlsBindings.Add(tb.Name, item.Name);
                    }
                    standard = true;
                }

                #region Generic type
                if (item.PropertyType.IsGenericType)
                {
                    generic = true;
                }
                #endregion

                #region Array Type
                if (item.PropertyType.IsArray)
                {
                    Type eltype = item.PropertyType.GetElementType();
                    if (TypesHelper.IsStandardType(eltype))
                    {
                    }

                    if (eltype.IsGenericType)
                    {
                    }

                    array = true;
                }
                #endregion

                #region Class type
                if (!standard && !generic && !array)
                {
                }
                #endregion
            }
            #endregion

            #region Ok & Cancel Buttons Creation
            Button but = new Button();
            but.Text = "ОК";
            but.Top = (this.Controls.Count * but.Height);
            but.Left = 2;
            this.Controls.Add(but);
            but = new Button();
            but.Text = "Отмена";
            but.Top = this.Controls[this.Controls.Count - 1].Top;
            but.Left = this.Controls[this.Controls.Count - 1].Width + 6;
            this.Controls.Add(but);
            #endregion
        }
开发者ID:Lootero4eg,项目名称:anvlib,代码行数:75,代码来源:DictionaryForm.cs

示例4: ReloadDecorTab


//.........这里部分代码省略.........
                                            MiddleLeft
                                    };
                                    diff = dinamicDownPosition - dinamicDownPositionPack;
                                    packControlsWhenChangeMode.Add(labelForConfigName, diff);
                                    var comboBoxConfig = new ComboBox
                                    {
                                        Location = new Point(
                                            labelForConfigName.
                                                Location
                                                .X +
                                            labelForConfigName.Size
                                                .
                                                Width,
                                            labelForConfigName.
                                                Location
                                                .Y),
                                        Size = new Size(50, 35),
                                        Name = nameForConfigLabel
                                    };
                                    packControlsWhenChangeMode.Add(comboBoxConfig, diff);
                                    var labelConfigSelected = new Label
                                    {
                                        Location = new Point(labelForConfigName.Location.X, labelForConfigName.Location.Y > 35 ? labelForConfigName.Location.Y - 35 : 0),
                                        Size = new Size(248, 25),
                                        Font = new Font("Tahoma", (float)7, FontStyle.Bold)
                                    };
                                    var seperateLine = new Label
                                    {
                                        Location = new Point(labelForConfigName.Location.X, labelForConfigName.Location.Y > 48 ? labelForConfigName.Location.Y - 48 : 0),
                                        Size = new Size(_tabDec.Size.Width, 20),
                                        Text = "_______________________________________________________",
                                        ForeColor = Color.DarkGray
                                    };
                                    seperateLine.SendToBack();
                                    comboBoxConfig.Tag = new KeyValuePair<Label, ComboBox>(labelConfigSelected, null);
                                    cb = comboBoxConfig;

                                    comboBoxConfig.KeyDown += ComboBoxConfigKeyDown;

                                    cm =
                                        new OleDbCommand(
                                            "SELECT * FROM decors_conf WHERE id = " +
                                            newL.Number +
                                            " AND Visible = true", oleDb);
                                    rd = cm.ExecuteReader();
                                    var strList = new Dictionary<int, string>();
                                    int l = 0;
                                    int numberCurrentConf = 0;
                                    var namesOfConfigurations = new List<string>();
                                    while (rd.Read())
                                    {
                                        string confName = rd["Configuration"].ToString();
                                        namesOfConfigurations.Add(confName);

                                    }
                                    rd.Close();

                                    namesOfConfigurations.Sort((x, y) => x.CompareTo(y));
                                    bool wasChangeConf = false;
                                    foreach (                                                   //нахождение нужной конфигурации и перезагрузка детали для этой конфигурации,
                                        var nameOfConfiguration in namesOfConfigurations)       //чтобы активная конфигурация в детали совпадала с активной конфигурацией в компоненте
                                    {
                                        Size size = TextRenderer.MeasureText(nameOfConfiguration, comboBoxConfig.Font);
                                        int lonhName = size.Width; //nameOfConfiguration.Length * 5;
                                        if (comboBoxConfig.DropDownWidth < lonhName)
                                            comboBoxConfig.DropDownWidth = lonhName;
开发者ID:digger1985,项目名称:MyCode,代码行数:67,代码来源:frmSetParameters.cs

示例5: frmInvoke_Load

        private void frmInvoke_Load(object sender, EventArgs e)
        {
            //自动生成列
            gridDataQuery.AutoGenerateColumns = true;
            webBrowser1.Url = new Uri("about:blank");

            lblServiceName.Text = serviceName;
            lblMethodName.Text = methodName;

            JObject obj = new JObject();
            if (!string.IsNullOrEmpty(paramValue))
            {
                obj = JObject.Parse(paramValue);
                if (obj.Count == 1 && obj["InvokeParameter"] != null)
                {
                    obj = JObject.Parse(obj["InvokeParameter"].ToString());
                }
            }

            if (parameters.Count > 0)
            {
                int index = 0;
                int countHeight = 0;
                foreach (var parameter in parameters)
                {
                    if (parameter.IsByRef && parameter.IsOut) continue;

                    Panel p = new Panel();
                    p.Top = (index++) * 48 + countHeight;
                    p.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
                    p.Width = plParameters.Width;
                    p.Height = 45;
                    //p.BorderStyle = BorderStyle.Fixed3D;

                    Label l = new Label();
                    l.Text = "【" + parameter.Name + "】 => " + parameter.TypeName;
                    l.Dock = DockStyle.Top;
                    l.AutoSize = false;
                    //l.BorderStyle = BorderStyle.Fixed3D;
                    l.TextAlign = ContentAlignment.MiddleLeft;
                    p.Controls.Add(l);

                    if (!parameter.IsPrimitive || parameter.IsEnum)
                    {
                        var text = "Parameter【" + parameter.Name + "】type: " + parameter.TypeFullName;
                        if (parameter.IsEnum || parameter.SubParameters.Count > 0)
                        {
                            text += "\r\n\r\n";
                            text += GetParameterText(parameter, 0);
                        }
                        toolTip1.SetToolTip(l, text);
                        l.ForeColor = Color.Red;
                        l.Click += new EventHandler((s, ee) =>
                        {
                            richTextBox1.Text = text;
                        });
                    }

                    TextBox t = new TextBox();
                    t.Dock = DockStyle.Fill;

                    //给参数赋值
                    if (obj.Count > 0)
                    {
                        if (obj[parameter.Name] != null)
                        {
                            t.Text = obj[parameter.Name].Value<string>();
                        }
                    }

                    t.Tag = parameter;
                    p.Controls.Add(t);

                    l.SendToBack();

                    if (!parameter.IsPrimitive)
                    {
                        t.Multiline = true;
                        p.Height += 50;

                        countHeight += 50;
                    }

                    plParameters.Controls.Add(p);
                    txtParameters[parameter.Name] = t;
                }
            }
            else
            {
                label3.Visible = false;
            }
        }
开发者ID:rajayaseelan,项目名称:mysoftsolution,代码行数:92,代码来源:frmInvoke.cs


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