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


C# BorderStyle类代码示例

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


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

示例1: CustomList

		protected CustomList(string name)
		{
			this.name=name;
			SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.DoubleBuffer|ControlStyles.UserPaint,true);

			collection = new ArrayList();

			vert = new VScrollBar();
			vert.Height=Height;
			vert.Location=new Point(Width-vert.Width,0);
			vert.Minimum=0;
			vert.Maximum=1;
			vert.Scroll+=new ScrollEventHandler(scroll);
			Controls.Add(vert);

			strList = new string[]{"Edit","Delete"};

			border = Border3DStyle.Etched;
			bStyle=BorderStyle.None;

			properties = new StrPropertyList();

			StrProperty.Update+=new NoArgsDelegate(Refresh);
//			allowedChars = new Hashtable();
//			allowedChars[Keys.Space]=' ';
		}
开发者ID:pmprog,项目名称:OpenXCOM.Tools,代码行数:26,代码来源:CustomList.cs

示例2: ApplyBorderLabel

        public static Texture2D ApplyBorderLabel(this Texture2D texture, BorderStyle style)
        {
            Texture2D newTexture = new Texture2D(texture.GraphicsDevice, texture.Width, texture.Height);
            Color[] data = texture.GetColorData();

            switch (style)
            {
                case (BorderStyle.FixedSingle):
                    for (int y = 0; y < texture.Height; y++)
                    {
                        for (int x = 0; x < texture.Width; x++)
                        {
                            if (y == 0 || x == 0 || y == texture.Height - 1 || x == texture.Width - 1)
                            {
                                data[x + y * texture.Width] = Color.DimGray;
                            }
                        }
                    }
                    newTexture.SetData(data);
                    return newTexture;
                case (BorderStyle.Fixed3D):
                    for (int y = 0; y < texture.Height; y++)
                    {
                        for (int x = 0; x < texture.Width; x++)
                        {
                            if (y == 0 || x == 0) data[x + y * texture.Width] = Color.DarkSlateGray;
                            else if (y == texture.Height - 1 || x == texture.Width - 1) data[x + y * texture.Width] = Color.White;
                        }
                    }
                    newTexture.SetData(data);
                    return newTexture;
                default:
                    return texture;
            }
        }
开发者ID:MentulaGames,项目名称:XnaGuiItems,代码行数:35,代码来源:Extentions.cs

示例3: NewCellStyle

        /// <summary>
        /// 创建单元格样式。
        /// </summary>
        /// <param name="workbook">工作表对象</param>
        /// <param name="styleCallback">单元格样式设置回调</param>
        /// <param name="fontCallback">字体设置回调</param>
        /// <param name="borderStyle">边框样式</param>
        /// <returns>单元格样式对象</returns>
        public static ICellStyle NewCellStyle(this IWorkbook workbook,
            Action<ICellStyle> styleCallback = null, Action<IFont> fontCallback = null, BorderStyle borderStyle = BorderStyle.Thin)
        {
            var font = workbook.CreateFont();
            var style = workbook.CreateCellStyle();

            font.FontName = "Courier New";
            font.FontHeightInPoints = 12;

            style.WrapText = false;
            style.Alignment = HorizontalAlignment.Center;
            style.VerticalAlignment = VerticalAlignment.Center;

            style.BorderLeft = borderStyle;
            style.BorderTop = borderStyle;
            style.BorderRight = borderStyle;
            style.BorderBottom = borderStyle;

            fontCallback?.Invoke(font);
            styleCallback?.Invoke(style);

            style.SetFont(font);

            return style;
        }
开发者ID:fenglinz,项目名称:Sparrow,代码行数:33,代码来源:NPOIExtensions.cs

示例4: PaintRectangle

		/// <summary>
		/// 
		/// </summary>
		/// <param name="graphics"></param>
		/// <param name="x"></param>
		/// <param name="y"></param>
		/// <param name="width"></param>
		/// <param name="height"></param>		
		/// <param name="fillStyle"></param>
		/// <param name="backColor"></param>
		/// <param name="fadeColor"></param>
		/// <param name="borderStyle"></param>
		/// <param name="borderColor"></param>
		public static void PaintRectangle(Graphics graphics, int x, int y, int width, int height, 
			FillStyle fillStyle, Color backColor, Color fadeColor, BorderStyle borderStyle, 
			Color borderColor)
		{
			OnPaintBackgroundClassic(x, y, width, height, fillStyle, backColor,
				fadeColor, borderStyle, borderColor, graphics);			
		}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:20,代码来源:AreaPainter.cs

示例5: Border

 public Border(float pmSize, BorderStyle pmStyle, Color pmColor)
 {
     top=	new BorderPiece(pmSize, pmStyle, pmColor);
     right=	new BorderPiece(pmSize, pmStyle, pmColor);
     bot=	new BorderPiece(pmSize, pmStyle, pmColor);
     left=	new BorderPiece(pmSize, pmStyle, pmColor);
 }
开发者ID:pgonzbecer,项目名称:apis-bundle,代码行数:7,代码来源:Border.cs

示例6: Border

 public Border(BorderStyle tcbs, BorderSize size, int space, Color color)
 {
     this.Tcbs = tcbs;
     this.Size = size;
     this.Space = space;
     this.Color = color;
 }
开发者ID:kenjiuno,项目名称:enex2docx,代码行数:7,代码来源:Border.cs

示例7: setStyle

 // Sets the given style to all the parts in the border
 public void setStyle(BorderStyle value)
 {
     top.style=	value;
     right.style=	value;
     bottom.style=	value;
     left.style=	value;
 }
开发者ID:pgonzbecer,项目名称:apis-bundle,代码行数:8,代码来源:Border.cs

示例8: SetMDIBorderStyle

        public static void SetMDIBorderStyle(MdiClient mdiClient, BorderStyle value)
        {
            // Get styles using Win32 calls
            int style = GetWindowLong(mdiClient.Handle, GWL_STYLE);
            int exStyle = GetWindowLong(mdiClient.Handle, GWL_EXSTYLE);

            // Add or remove style flags as necessary.
            switch (value)
            {
                case BorderStyle.Fixed3D:
                    exStyle |= WS_EX_CLIENTEDGE;
                    style &= ~WS_BORDER;
                    break;

                case BorderStyle.FixedSingle:
                    exStyle &= ~WS_EX_CLIENTEDGE;
                    style |= WS_BORDER;
                    break;

                case BorderStyle.None:
                    style &= ~WS_BORDER;
                    exStyle &= ~WS_EX_CLIENTEDGE;
                    break;
            }

            // Set the styles using Win32 calls
            SetWindowLong(mdiClient.Handle, GWL_STYLE, style);
            SetWindowLong(mdiClient.Handle, GWL_EXSTYLE, exStyle);

            // Update the non-client area.
            SetWindowPos(mdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
                SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
                SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
        }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:34,代码来源:Win32Util.cs

示例9: DrawFullRectangle

        public static ShapeDescription DrawFullRectangle(Vector3 position, Size size, IGradientShader linearShader, Color4 fillColor, Thickness borderSize, BorderStyle borderStyle, Color4 borderColor)
        {
            Color4[] shadedColors = linearShader.Method(linearShader, 4,Shape.Rectangle);
            Color4[] borderColors;

            switch (borderStyle)
            {
                case BorderStyle.None:
                    borderColors = LinearShader.FillColorArray(new Color4(0), 4);
                    break;
                case BorderStyle.Flat:
                    borderColors = LinearShader.FillColorArray(borderColor, 4);
                    break;
                case BorderStyle.Raised:
                    borderColors = LinearShader.BorderRaised(borderColor, 4);
                    break;
                case BorderStyle.Sunken:
                    borderColors = LinearShader.BorderSunken(borderColor, 4);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("borderStyle");
            }
            ShapeDescription inside = DrawRectangle(position, size, shadedColors);
            ShapeDescription outline = DrawRectangularOutline(position, size, borderSize.All, borderColors, borderStyle, Borders.All);

            ShapeDescription result = ShapeDescription.Join(inside, outline);
            result.Shape = Shape.RectangleWithOutline;
            return result;
        }
开发者ID:yong-ja,项目名称:starodyssey,代码行数:29,代码来源:ShapeCreator.Rectangle.cs

示例10: Convert

 public static BorderStyle Convert(String value, BorderStyle defaultValue)
 {
     if (value == "None")
     {
         return BorderStyle.None;
     }
     else if (value == "Flat")
     {
         return BorderStyle.Flat;
     }
     else if (value == "Lowered")
     {
         return BorderStyle.Lowered;
     }
     else if (value == "Raised")
     {
         return BorderStyle.BorderRaised;
     }
     else if (value == "FlatDouble")
     {
         return BorderStyle.BorderFlatDouble;
     }
     else if (value == "LoweredDouble")
     {
         return BorderStyle.BorderLoweredDouble;
     }
     else if (value == "RaisedDouble")
     {
         return BorderStyle.BorderRaisedDouble;
     }
     else
     {
         return defaultValue;
     }
 }
开发者ID:drme,项目名称:thw-ui,代码行数:35,代码来源:Converter.cs

示例11: BorderLayer

 public BorderLayer(String name, int width, BorderStyle style, Color color)
     : base(name, SolidColours.White)
 {
     borderWidth = width;
     borderStyle = style;
     borderColour = color;
 }
开发者ID:hookkshot,项目名称:BluEngine,代码行数:7,代码来源:BorderLayer.cs

示例12: CusCtlCurveBorderDrawPanel

 public CusCtlCurveBorderDrawPanel()
 {
     base.BackColor = Color.Transparent;
     base.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this._BorderColor = Color.Black;
     this._BorderStyle = Liplis.Control.BorderStyle.None;
     this._BorderWidth = 1;
 }
开发者ID:yuta1011tokyo,项目名称:Liplis-Windows,代码行数:8,代码来源:CusCtlCurveBorderDrawPanel.cs

示例13: DrawBorder

        public static Image DrawBorder(BorderStyle style, Image img, Color color, int size)
        {
            if (style == BorderStyle.Inside)
            {
                return DrawBorderInside(img, color, size);
            }

            return DrawBorderOutside(img, color, size);
        }
开发者ID:dmitriydel,项目名称:sharexmod,代码行数:9,代码来源:ImageEffectsHelper.cs

示例14: ToolStripTextBox

		public ToolStripTextBox () : base (new ToolStripTextBoxControl ())
		{
			ToolStripTextBoxControl text_box = TextBox as ToolStripTextBoxControl;
			text_box.OwnerItem = this;
			text_box.border_style = BorderStyle.None;
			text_box.TopMargin = 3; // need to explicitly set the margin
			text_box.Border = BorderStyle.Fixed3D; // ToolStripTextBoxControl impl, not TextBox
			this.border_style = BorderStyle.Fixed3D;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:ToolStripTextBox.cs

示例15: Properties

 public DgvHelper Properties(string font = "Courier New", int fontSize = 9, Color foreColor = default(Color), Color backColor = default(Color), BorderStyle borderStyle = default(BorderStyle), bool virtualMode = false, bool rowHeaderVisible = false)
 {
     Dgv.VirtualMode = virtualMode;
     Dgv.RowHeadersVisible = rowHeaderVisible;
     Dgv.DefaultCellStyle.Font = new Font(font, fontSize);
     Dgv.DefaultCellStyle.ForeColor = foreColor;
     Dgv.DefaultCellStyle.BackColor = backColor;
     Dgv.BorderStyle = borderStyle;
     return this;
 }
开发者ID:lilvonz,项目名称:SchoolAccountant,代码行数:10,代码来源:DgvHelper.cs


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