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


C# ElementStyle类代码示例

本文整理汇总了C#中ElementStyle的典型用法代码示例。如果您正苦于以下问题:C# ElementStyle类的具体用法?C# ElementStyle怎么用?C# ElementStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ResetBackgroundStyle

 public void ResetBackgroundStyle()
 {
     _BackgroundStyle.StyleChanged -= new EventHandler(this.VisualPropertyChanged);
     _BackgroundStyle = new ElementStyle();
     _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
     this.Invalidate();
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:7,代码来源:ControlWithBackgroundStyle.cs

示例2: NodeRendererEventArgs

		public NodeRendererEventArgs(Graphics g, Node node, Rectangle bounds, ElementStyle style)
		{
			this.Graphics = g;
			this.Node = node;
			this.NodeBounds = bounds;
			this.Style = style;
		}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: GetElementStyleDisplayInfo

		/// <summary>
		/// Returns ElementStyleDisplayInfo class that provides information for ElementStyle rendering.
		/// </summary>
		/// <param name="style">Reference to style.</param>
		/// <param name="g">Reference to graphics object.</param>
		/// <param name="bounds">Style bounds</param>
		/// <returns>New instance of ElementStyleDisplayInfo</returns>
		protected ElementStyleDisplayInfo GetElementStyleDisplayInfo(ElementStyle style, Graphics g, Rectangle bounds)
		{
			m_ElementStyleDisplayInfo.Style=style;
			m_ElementStyleDisplayInfo.Graphics=g;
			m_ElementStyleDisplayInfo.Bounds=bounds;
			return m_ElementStyleDisplayInfo;
		}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例4: ListViewEx

 public ListViewEx()
     : base()
 {
     m_BorderStyle = new ElementStyle();
     m_BorderStyle.Class = ElementStyleClassKeys.ListViewBorderKey;
     m_BorderStyle.StyleChanged += new EventHandler(BorderStyle_StyleChanged);
     m_NCPainter = new NonClientPaintHandler(this, eScrollBarSkin.Optimized);
     this.OwnerDraw = true;
     this.DoubleBuffered = true;
     this.BorderStyle = BorderStyle.None;
     StyleManager.Register(this);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:12,代码来源:ListViewEx.cs

示例5: ControlWithBackgroundStyle

        /// <summary>
        /// Initializes a new instance of the ControlWithBackgroundStyle class.
        /// </summary>
        public ControlWithBackgroundStyle()
        {
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.StandardDoubleClick, true);
            this.SetStyle(DisplayHelp.DoubleBufferFlag, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            _BackgroundStyle = new ElementStyle();
            _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:16,代码来源:ControlWithBackgroundStyle.cs

示例6: TextBoxX

        public TextBoxX()
        {
#if FRAMEWORK20
            _ButtonCustom = new InputButtonSettings(this);
            _ButtonCustom2 = new InputButtonSettings(this);
            CreateButtonGroup();
#endif

            m_BorderStyle = new ElementStyle();
            m_BorderStyle.StyleChanged += new EventHandler(BorderStyle_StyleChanged);
            m_NCPainter = new NonClientPaintHandler(this, eScrollBarSkin.Optimized);
            base.BorderStyle = BorderStyle.None;
            this.AutoSize = false;
            StyleManager.Register(this);
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:15,代码来源:TextBoxX.cs

示例7: CalculateStyleSize

		/// <summary>
		/// Calculates size of an style element.
		/// </summary>
		/// <param name="style">Style to calculate size for.</param>
		/// <param name="defaultFont">Default font that will be used by style if style does not uses it's own font.</param>
		/// <returns>Size of the style element. At this time only Height memeber will be calculated.</returns>
		public static void CalculateStyleSize(ElementStyle style, Font defaultFont)
		{
			int height=defaultFont.Height;
            ElementStyle s = ElementStyleDisplay.GetElementStyle(style);
			if(s.Font!=null)
				height=s.Font.Height;
			
			if(s.PaintTopBorder)
			{
				height+=s.BorderTopWidth;
			}

			if(s.PaintBottomBorder)
			{
				height+=s.BorderBottomWidth;
			}
			
			height+=(s.MarginTop+style.MarginBottom);
			height+=(s.PaddingTop+s.PaddingBottom);
			
			style.SetSize(new Size(0,height));
		}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例8: PaintInnerContent

        protected override void PaintInnerContent(System.Windows.Forms.PaintEventArgs e, ElementStyle style, bool paintText)
        {
            base.PaintInnerContent(e, style, paintText);

            if (!m_IsShadowEnabled) return;
            Graphics g = e.Graphics;
            ShadowPaintInfo pi = new ShadowPaintInfo();
            pi.Graphics = g;
            pi.Size = 6;
            foreach (Control c in this.Controls)
            {
                if (!c.Visible || c.BackColor == Color.Transparent && !(c is GroupPanel)) continue;
                if (c is GroupPanel)
                {
                    GroupPanel p = c as GroupPanel;
                    pi.Rectangle = new Rectangle(c.Bounds.X, c.Bounds.Y + p.GetInternalClientRectangle().Y/2, c.Bounds.Width, c.Bounds.Height - p.GetInternalClientRectangle().Y/2);
                }
                else
                    pi.Rectangle = c.Bounds;
                ShadowPainter.Paint2(pi);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例9: GetMenuBottomContainer

        public static ElementStyle GetMenuBottomContainer(Office2007ColorTable table)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonFileMenuBottomContainerKey;
            Rendering.Office2007MenuColorTable mc = table.Menu;

            //BackgroundColorBlend[] blend = new BackgroundColorBlend[mc.FileBottomContainerBackgroundBlend.Count];
            //mc.FileBottomContainerBackgroundBlend.CopyTo(blend);
            //style.BackColorBlend.Clear();
            //style.BackColorBlend.AddRange(blend);
            //style.BackColorGradientAngle = 90;
            style.MarginTop = 2;
            style.MarginRight = 2;
            return style;
        }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例10: GetMenuColumnOneContainerStyle

        public static ElementStyle GetMenuColumnOneContainerStyle(Office2007ColorTable table)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonFileMenuColumnOneContainerKey;
            Rendering.Office2007MenuColorTable mc = table.Menu;

            style.BackColor = mc.FileColumnOneBackground;
            style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
            style.BorderRightColor = mc.FileColumnOneBorder;
            style.BorderRightWidth = 1;
            style.PaddingRight = 1;

            return style;
        }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例11: GetFileMenuContainerStyle

        public static ElementStyle GetFileMenuContainerStyle(Office2007ColorTable table)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonFileMenuContainerKey;
            Rendering.Office2007MenuColorTable mc = table.Menu;

            style.PaddingBottom = 3;
            style.PaddingLeft = 0;
            style.PaddingRight = 0;
            style.PaddingTop = 22;
            style.Border = eStyleBorderType.Solid;
            style.CornerType = eCornerType.Rounded;
            style.BorderWidth = 1;
            style.BorderColor = Color.Transparent;
            style.CornerDiameter = 3;
            BackgroundColorBlend[] blend = new BackgroundColorBlend[mc.FileBackgroundBlend.Count];
            mc.FileBackgroundBlend.CopyTo(blend);
            style.BackColorBlend.Clear();
            style.BackColorBlend.AddRange(blend);
            style.BackColorGradientAngle = 90;
            return style;
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例12: GetRibbonClientPanelStyle

        public static ElementStyle GetRibbonClientPanelStyle(ColorFactory f, eOffice2010ColorScheme cs)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonClientPanelKey;

            style.BackColorGradientAngle = 90;

            if (cs == eOffice2010ColorScheme.Blue)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xC7DAF0), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x9AB3CF), .7f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x85A1C0), 1));
            }
            else if (cs == eOffice2010ColorScheme.Silver)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xCDD1D6), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xC0C4C8), .7f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xBABEC2), 1));
            }
            else if (cs == eOffice2010ColorScheme.Black)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x6F6F6F), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x4F4F4F), .7f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x3F3F3F), 1));
            }

            return style;
        }
开发者ID:,项目名称:,代码行数:28,代码来源:

示例13: RightWhiteSpace

		/// <summary>
		/// Returns total white space for right side of the style. Whitespace is the space between the edge of the element and inner content of the element.
		/// </summary>
		/// <param name="es">Style to return white space for.</param>
		/// <returns></returns>
		public static int RightWhiteSpace(ElementStyle es)
		{
			return ElementStyleLayout.StyleSpacing(es,RightWhiteSpaceParts,eStyleSide.Right);
		}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例14: VerticalStyleWhiteSpace

		/// <summary>
		/// Returns the total white space for a style. Whitespace is the space between the edge of the element and inner content of the element.
		/// </summary>
		/// <param name="es">Style to return white space for.</param>
		/// <returns></returns>
		public static int VerticalStyleWhiteSpace(ElementStyle es)
		{
			return TopWhiteSpace(es)+BottomWhiteSpace(es);
		}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例15: InitControl

        private void InitControl()
        {
            _BackgroundStyle.SetColorScheme(this.ColorScheme);
            _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged);

            _ButtonCustom = new InputButtonSettings(this);
            _ButtonCustom2 = new InputButtonSettings(this);
            _ButtonClear = new InputButtonSettings(this);
            _ButtonDropDown = new InputButtonSettings(this);
            CreateButtonGroup();

            //_TextBox = new TextBoxX();
            //_TextBox.BorderStyle = BorderStyle.None;
            //_TextBox.TextChanged += new EventHandler(TextBoxTextChanged);
            //_TextBox.TextAlignChanged += new EventHandler(TextBoxTextAlignChanged);
            //_TextBox.SizeChanged += new EventHandler(TextBoxSizeChanged);
            //_TextBox.Visible=false;
            ////_TextBox.ModifiedChanged += new EventHandler(TextBoxModifiedChanged);
            //this.Controls.Add(_TextBox);

            // Init popup tree
            _AdvTree = new DevComponents.AdvTree.AdvTree();
#if (!TRIAL)
            _AdvTree.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
#endif
            _AdvTree.BackgroundStyle.Reset();
            _AdvTree.BackgroundStyle.BackColor = SystemColors.Window;
            _AdvTree.BackgroundStyle.Border = eStyleBorderType.None;
            _AdvTree.ExpandButtonType = eExpandButtonType.Triangle;
            _AdvTree.DragDropEnabled = false;
            _AdvTree.HotTracking = true;
            _AdvTree.Indent = 6;
            _AdvTree.SelectionFocusAware = false;
            ElementStyle nodeStyle = new ElementStyle();
            nodeStyle.Name = "nodeElementStyle";
            nodeStyle.TextColor = System.Drawing.SystemColors.ControlText;
            _AdvTree.NodeStyle = nodeStyle;
            _AdvTree.PathSeparator = ";";
            _AdvTree.Styles.Add(nodeStyle);
            _AdvTree.AfterNodeSelect += new AdvTreeNodeEventHandler(TreeAfterNodeSelect);
            _AdvTree.BeforeNodeSelect += new AdvTreeNodeCancelEventHandler(TreeBeforeNodeSelect);
            _AdvTree.NodeMouseDown += new TreeNodeMouseEventHandler(TreeNodeMouseDown);

            this.DropDownControl = _AdvTree;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:45,代码来源:ComboTree.cs


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