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


C# IControlFactory.CreateLabel方法代码示例

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


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

示例1: MainTitleIconControlWin

        /// <summary>
        /// Constructs a <see cref="MainTitleIconControlWin"/>
        /// </summary>
        public MainTitleIconControlWin(IControlFactory controlFactory)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            _controlFactory = controlFactory;
            _panel = _controlFactory.CreatePanel();
            ((PanelWin)_panel).BackgroundImage = CollapsiblePanelResource.headergradient;
            _panel.BackColor = Color.Transparent;
            _panel.Dock = Habanero.Faces.Base.DockStyle.Top;

            _panel.Height = 23;

            _icon = _controlFactory.CreateLabel();
            ((LabelWin)_icon).BackgroundImage = CollapsiblePanelResource.headergradient;
            _icon.BackColor = Color.Transparent;
            ((LabelWin)_icon).BackgroundImageLayout = ImageLayout.Center;
            _icon.Dock = Habanero.Faces.Base.DockStyle.Left;
            _icon.Size = new Size(20, 20);

            _title = _controlFactory.CreateLabel();
            _title.Dock = Habanero.Faces.Base.DockStyle.Fill;
            _title.BackColor = Color.Transparent;
            _title.TextAlign = ContentAlignment.MiddleLeft;
            _title.ForeColor = Color.White;

            _panel.Controls.Add(_title);
            _panel.Controls.Add(_icon);
            _panel.MaximumSize = new Size(2000, 23);
            this.Dock = DockStyleWin.GetDockStyle(DockStyle.Top);
            this.Controls.Add((PanelWin)_panel);
            this.Height = 23;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:34,代码来源:MainTitleIconControlWin.cs

示例2: MainTitleIconControlVWG

        /// <summary>
        /// Constructs a <see cref="MainTitleIconControlVWG"/>
        /// </summary>
        public MainTitleIconControlVWG(IControlFactory controlFactory)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            _controlFactory = controlFactory;
            _panel = _controlFactory.CreatePanel();
            ((PanelVWG)_panel).BackgroundImage = @"Images.headergradient.png";
            
            _panel.BackColor = Color.Transparent;
            _panel.Dock = Habanero.Faces.Base.DockStyle.Top;
            
            _panel.Height = 23;
            this.Size = new Size(_panel.Width,_panel.Height);
            _icon = _controlFactory.CreateLabel();
            ((LabelVWG)_icon).BackgroundImage = "";
            _icon.BackColor = Color.Transparent;
            ((LabelVWG)_icon).BackgroundImageLayout = ImageLayout.Center;
            _icon.Dock = Habanero.Faces.Base.DockStyle.Left;
            _icon.Size = new Size(20, 20);

            _title = _controlFactory.CreateLabel();
            _title.Font = new Font("Verdana", 10);
            _title.Dock = Habanero.Faces.Base.DockStyle.Fill;
            _title.BackColor = Color.Transparent;
            _title.TextAlign = ContentAlignment.MiddleLeft;
            _title.ForeColor = Color.White;

            _panel.Controls.Add(_title);
            _panel.Controls.Add(_icon);

            this.Dock = DockStyleVWG.GetDockStyle(DockStyle.Top);
            this.Controls.Add((PanelVWG)_panel);
            this.Height = 23;
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:36,代码来源:MainTitleIconControlVWG.cs

示例3: HelpAboutBoxManager

        ///<summary>
        /// Constructor for the <see cref="HelpAboutBoxManager"/>
        ///</summary>
        ///<param name="controlFactory"></param>
        ///<param name="formHabanero"></param>
        ///<param name="programName"></param>
        ///<param name="producedForName"></param>
        ///<param name="producedByName"></param>
        ///<param name="versionNumber"></param>
        public HelpAboutBoxManager(IControlFactory controlFactory, IFormHabanero formHabanero, string programName, string producedForName, string producedByName, string versionNumber)
        {
            _FormHabanero = formHabanero;
            _mainPanel = controlFactory.CreatePanel();
            GridLayoutManager mainPanelManager = new GridLayoutManager(_mainPanel, controlFactory);
            mainPanelManager.SetGridSize(4, 2);
            mainPanelManager.FixAllRowsBasedOnContents();
            mainPanelManager.FixColumnBasedOnContents(0);
            mainPanelManager.FixColumnBasedOnContents(1);
            mainPanelManager.AddControl(controlFactory.CreateLabel("Programme Name:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(programName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced For:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedForName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Produced By:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(producedByName, false));
            mainPanelManager.AddControl(controlFactory.CreateLabel("Version:", false));
            mainPanelManager.AddControl(controlFactory.CreateLabel(versionNumber, false));

            IButtonGroupControl buttons = controlFactory.CreateButtonGroupControl();
            buttons.AddButton("OK", new EventHandler(OKButtonClickHandler));

            BorderLayoutManager manager = controlFactory.CreateBorderLayoutManager(formHabanero);
            manager.AddControl(_mainPanel, BorderLayoutManager.Position.Centre);
            manager.AddControl(buttons, BorderLayoutManager.Position.South);
            formHabanero.Width = 300;
            formHabanero.Height = 200;
            formHabanero.Text = "About";
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:37,代码来源:HelpAboutBoxManager.cs

示例4: CreateColoredPanel

 private static IPanel CreateColoredPanel(IControlFactory controlFactory, string labelPrefix)
 {
     System.Windows.Forms.Panel panel = (System.Windows.Forms.Panel)controlFactory.CreatePanel();
     ILabel label = controlFactory.CreateLabel(labelPrefix);
     label.Height = 15;
     label.BackColor = Color.White;
     panel.Controls.Add((System.Windows.Forms.Control)label);
     panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     panel.BackColor = Color.FromArgb(TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255));
     return (IPanel)panel;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:11,代码来源:TestGridLayoutManagerWin.cs

示例5: CreateColoredPanel

 private static IPanel CreateColoredPanel(IControlFactory controlFactory, string labelPrefix)
 {
     System.Windows.Forms.Panel panel = (System.Windows.Forms.Panel)controlFactory.CreatePanel();
     ILabel label = controlFactory.CreateLabel(labelPrefix + "Left-Click to grow, Right-Click to shrink.");
     label.Height = 15;
     label.BackColor = Color.White;
     panel.Controls.Add((System.Windows.Forms.Control)label);
     panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     panel.MouseDown += (sender, e) =>
                            {
                                if (e.Button == System.Windows.Forms.MouseButtons.Left) panel.Height += 5;
                                if (e.Button == System.Windows.Forms.MouseButtons.Right) panel.Height -= 5;
                            };
     panel.BackColor = Color.FromArgb(TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255), TestUtil.GetRandomInt(255));
     return (IPanel)panel;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:16,代码来源:TestColumnLayoutManagerWin.cs

示例6: CloseBOEditorDialogWin

/*
        ///<summary>
        /// Construct the Dialog form for any situation e.g. where the Form being closed has 
        /// Mutliple Business Objects is a wizard etc.
        ///</summary>
        /// <param name="controlFactory">The control Factory used to construct buttons, labels etc by ths control</param>
        ///<param name="fullDisplayName">Full display name for the BusienssObject(s)</param>
        ///<param name="isInValidState">Are the BusinessObject(s) in a valid state</param>
        ///<param name="isDirty"></param>
        ///<exception cref="ArgumentNullException">control Factory must not be null</exception>
        public CloseBOEditorDialogWin(IControlFactory controlFactory, string fullDisplayName, bool isInValidState, bool isDirty)
        {
            if (controlFactory == null) throw new ArgumentNullException("controlFactory");
            ConstructControl(controlFactory, fullDisplayName, isInValidState, isDirty);
            SetSize();
        }*/



        private void ConstructControl(IControlFactory controlFactory)
        {
            IButtonGroupControl buttonGroupControl = controlFactory.CreateButtonGroupControl();
            CancelCloseBtn = buttonGroupControl.AddButton("CancelClose", "Cancel Close", ButtonClick);
            CloseWithoutSavingBtn = buttonGroupControl.AddButton("CloseWithoutSaving", "&Close without saving", ButtonClick);
            SaveAndCloseBtn = buttonGroupControl.AddButton("SaveAndClose","&Save & Close", ButtonClick);
            
            _label = controlFactory.CreateLabel();
            BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(this);
            layoutManager.AddControl(_label, BorderLayoutManager.Position.Centre);
            layoutManager.AddControl(buttonGroupControl, BorderLayoutManager.Position.South);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:31,代码来源:CloseBOEditorDialogWin.cs


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