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]=' '; }
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; } }
/// <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; }
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); }
public BorderLayer(String name, int width, BorderStyle style, Color color) : base(name, SolidColours.White) { borderWidth = width; borderStyle = style; borderColour = color; }
/// <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); }
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; } }
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); }
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; }
public Border(BorderStyle tcbs, BorderSize size, int space, Color color) { this.Tcbs = tcbs; this.Size = size; this.Space = space; this.Color = color; }
// 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; }
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; }
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); }
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; }
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; }
/// <summary> /// Creates a circle shape with a designated border width. The circle begins and ends at border_origin_radians. /// </summary> public static Shape CreateBorderedCircle(Vector3 origin, float radius, float border_width, float border_origin_radians, Vector4 uv, BorderStyle style, Color? hue = null) { float inner_delta = 0f, outer_delta = 0f; switch (style) { case BorderStyle.Centered: inner_delta = outer_delta = border_width / 2f; break; case BorderStyle.Inside: inner_delta = border_width; break; case BorderStyle.Outside: outer_delta = border_width; break; } int numSegments = segmentsForSmoothCircle(radius); float radiansPerPoint = (Math.PI * 2) / numSegments; Vector3[] pointsOutside = new Vector3[numSegments + 1], pointsInside = new Vector3[numSegments + 1]; // really, we only need to generate numPoints, but generating the final point (which is equal to the first point // saves us a mod operation in the next for loop. for (int i = 0; i < numSegments + 1; i++) { pointsOutside[i] = new Vector3( origin.X + Math.Cos(radiansPerPoint * i + border_origin_radians) * (radius + outer_delta), origin.Y + Math.Sin(radiansPerPoint * i + border_origin_radians) * (radius + outer_delta), origin.Z); pointsInside[i] = new Vector3( origin.X + Math.Cos(radiansPerPoint * i + border_origin_radians) * (radius - inner_delta), origin.Y + Math.Sin(radiansPerPoint * i + border_origin_radians) * (radius - inner_delta), origin.Z); } VertexPositionTextureHueExtra[] vertices = new VertexPositionTextureHueExtra[(numSegments) * 4]; Color color = (hue.HasValue) ? hue.Value : Color.White; for (int i = 0; i < numSegments; i++) { int i4 = i * 4; int i6 = i * 6; vertices[i4 + 0] = new VertexPositionTextureHueExtra(pointsOutside[i + 0], new Vector2(uv.X, uv.Y), color, Vector4.Zero); vertices[i4 + 1] = new VertexPositionTextureHueExtra(pointsOutside[i + 1], new Vector2(uv.Z, uv.Y), color, Vector4.Zero); vertices[i4 + 2] = new VertexPositionTextureHueExtra(pointsInside[i + 0], new Vector2(uv.X, uv.W), color, Vector4.Zero); vertices[i4 + 3] = new VertexPositionTextureHueExtra(pointsInside[i + 1], new Vector2(uv.Z, uv.W), color, Vector4.Zero); } Shape shape = new Shape(); shape.Vertices = vertices; return shape; }
public CrtPanel(CrtControl parent, int column, int row, int width, int height, BorderStyle ABorder, int AForeColour, int backColour, string text, CrtAlignment textAlignment) : base(parent, column, row, width, height) { _Border = ABorder; _ForeColour = AForeColour; _BackColour = backColour; _Text = text; _TextAlignment = textAlignment; Paint(true); }
public ProgramSettings(string file, string NiceName) { Filepath = file; FileName = NiceName; //Some defaults Borderstyle = BorderStyle.SIZABLE; WindowState = WinState.NORMAL; Style = 382664704; Enabled = false; }
/// <summary> /// A class designed to allow easy rotation to change the angle /// </summary> public AnglePicker() { _knobVisible = true; _knobRadius = 5; _circleBorderStyle = BorderStyle.Fixed3D; _circleBorderColor = Color.LightGray; _circleFillColor = Color.LightGray; _pieFillColor = Color.SteelBlue; _knobColor = Color.Green; _textAlignment = ContentAlignment.BottomCenter; Width = 50; Height = 50; InitializeComponent(); }
// Get the width of the specified border type public virtual int GetBorderWidth(BorderStyle border) { switch(border) { case BorderStyle.Fixed3D: return 2; case BorderStyle.FixedSingle: return 1; case BorderStyle.None: return 0; default: return 0; } }
public void SetUpFixture() { CreatedComponents.Clear(); WixDocument doc = new WixDocument(); doc.LoadXml(GetWixXml()); WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader()); using (Form dialog = wixDialog.CreateDialog(this)) { Label line = (Label)dialog.Controls[0]; lineName = line.Name; lineLocation = line.Location; lineBorder = line.BorderStyle; lineSize = line.Size; } }
public void Create( byte[] color, int line, int beginLongeurCadre, int endLongeurCadre, string[] values, bool isMerged, BorderStyle tailleBorder, bool withCadre = true, byte[] fontColor = null) { if(fontColor == null) { fontColor = new byte[3] { 0, 0, 0 }; } _tailleBorder = tailleBorder; var merged = new CellRangeAddress(line, line, beginLongeurCadre, endLongeurCadre); var longeur = beginLongeurCadre; foreach (var value in values) { var cell = _sheet.GetRow(line).GetCell(longeur); var style = CreateStyle(color, fontColor); if (withCadre) { SetStyleWithCadre(longeur, beginLongeurCadre, endLongeurCadre, style); } else { SetStyleWithoutCadre(longeur, beginLongeurCadre, endLongeurCadre, style); } cell.CellStyle = style; if (isMerged) { _sheet.AddMergedRegion(merged); } cell.SetCellValue(value); longeur++; } }
/// <summary> /// Initializes a new instance of the <see cref="Slusser.Components.MdiClientController"/> class /// for the given MDI form. /// </summary> /// <param name="parentForm">The MDI form.</param> public MdiClientController(Form parentForm) { // Initialize the variables. this.site = null; this.parentForm = null; this.mdiClient = null; this.backColor = SystemColors.AppWorkspace; this.borderStyle = BorderStyle.Fixed3D; this.autoScroll = true; this.image = null; this.imageAlign = ContentAlignment.MiddleCenter; this.stretchImage = false; // Set the ParentForm property. this.ParentForm = parentForm; }
public void Create( int beginHauteurCadre, int beginLongeurCadre, int endHauteurCadre, int endLongeurCadre, byte[] color, BorderStyle tailleBorder, CellRangeAddress merge = null, bool wrapText = false, bool center = false, bool forcedRightBorder = false) { _tailleBorder = tailleBorder; if (merge != null) { _sheet.AddMergedRegion(merge); } for (var hauteur = beginHauteurCadre; hauteur <= endHauteurCadre; hauteur++) { var row = _sheet.GetRow(hauteur); if (row == null) { row = _sheet.CreateRow(hauteur); } for (var longeur = beginLongeurCadre; longeur <= endLongeurCadre; longeur++) { var cell = row.CreateCell(longeur); var style = CreateStyle(color); SetStyle(hauteur, longeur, beginHauteurCadre, beginLongeurCadre, endHauteurCadre, endLongeurCadre, style, forcedRightBorder); style.WrapText = wrapText; if (center) { style.VerticalAlignment = VerticalAlignment.Center; style.Alignment = HorizontalAlignment.Center; } cell.CellStyle = style; } } }
public ListView() { items = new ListViewItemCollection(this); columns = new ColumnHeaderCollection(this); listItems = new ArrayList(); autoArrange = true; hideSelection = true; labelWrap = true; multiSelect = true; scrollable = true; activation = ItemActivation.Standard; alignStyle = ListViewAlignment.Top; borderStyle = BorderStyle.Fixed3D; headerStyle = ColumnHeaderStyle.Clickable; sorting = SortOrder.None; viewStyle = View.LargeIcon; }
public TweetTextField() { InitializeComponent(); //default border color m_pnBorderPen = new Pen(Color.FromArgb(180, 180, 180)); m_fntFont = new Font("Arial", 9); m_bsBorderStyle = BorderStyle.None; base.BorderStyle = System.Windows.Forms.BorderStyle.None; m_bConstrictHeight = true; m_bAlreadyUpdating = false; m_iControlMargin = 1; rtbTextBox.Click += new EventHandler(rtbTextBox_Click); rtbTextBox.TextChanged += new EventHandler(rtbTextBox_TextChanged); this.GotFocus += new EventHandler(TweetTextField_GotFocus); rtbTextBox.GotFocus += new EventHandler(rtbTextBox_GotFocus); }
public static ShapeDescription DrawRectangularOutline(Vector3 position, Size size, int borderSize, Color4[] colors, BorderStyle borderStyle, Borders borders) { ShapeDescription vBorderTop = default(ShapeDescription); ShapeDescription vBorderSideL = default(ShapeDescription); ShapeDescription vBorderSideR = default(ShapeDescription); ShapeDescription vBorderBottom = default(ShapeDescription); Vector3 innerPositionTopLeft = new Vector3( position.X + borderSize, position.Y - borderSize, position.Z); Vector3 borderPositionTopRight = new Vector3( position.X + size.Width - borderSize, position.Y, position.Z); Vector3 borderPositionBottomLeft = new Vector3( position.X, position.Y - size.Height + borderSize, position.Z); Size borderTop = new Size(size.Width, borderSize); Size borderSide = new Size(borderSize, size.Height); Color4 cLeft = colors[0]; Color4 cTop = colors[1]; Color4 cBottom = colors[2]; Color4 cRight = colors[3]; if ((borders & Borders.Top) != 0) vBorderTop = DrawRectangle(position, borderTop, cTop); if ((borders & Borders.Left) != 0) vBorderSideL = DrawRectangle(position, borderSide, cLeft); if ((borders & Borders.Right) != 0) vBorderSideR = DrawRectangle(borderPositionTopRight, borderSide, cRight); if ((borders & Borders.Bottom) != 0) vBorderBottom = DrawRectangle(borderPositionBottomLeft, borderTop, cBottom); switch (borderStyle) { case BorderStyle.Flat: case BorderStyle.Raised: return ShapeDescription.Join(vBorderSideL, vBorderTop, vBorderSideR, vBorderBottom); case BorderStyle.Sunken: return ShapeDescription.Join(vBorderSideL, vBorderSideR, vBorderTop, vBorderBottom); default: throw Error.WrongCase("borderStyle", "DrawRectangularOutline", borderStyle); } }
static public void ApplyBorderStyle(this IHTMLElement e, BorderStyle value) { if (value == BorderStyle.None) { e.style.border = ""; } else if (value == BorderStyle.FixedSingle) { e.style.borderStyle = "solid"; e.style.borderWidth = "1px"; e.style.borderColor = Shared.Drawing.Color.System.ActiveBorder; } else { e.style.borderStyle = "inset"; e.style.borderWidth = "1px"; e.style.borderColor = Shared.Drawing.Color.System.ActiveBorder; } }
public Border() { bounds= Rectangle.EMPTY; colors= new GUIColorPacket ( new Color(0, 0, 0), new Color(0, 0, 0), new Color(0, 0, 0), new Color(0, 0, 0) ); secondSetColors= new GUIColorPacket ( new Color(255, 255, 255), new Color(255, 255, 255), new Color(255, 255, 255), new Color(255, 255, 255) ); borderSize= 1f; style= BorderStyle.SOLID; }
/// <summary> /// Initializes a new instance of the <see cref="PdfBorderStyle"/> class. /// </summary> /// <param name="width">The border width.</param> /// <param name="style">The border style.</param> public PdfBorderStyle(int width, BorderStyle style) { Elements.SetInteger("/W", width); switch (style) { case BorderStyle.Solid: Elements.SetName("/S", "/S"); break; case BorderStyle.Dashed: Elements.SetName("/S", "/D"); break; case BorderStyle.Beveled: Elements.SetName("/S", "/B"); break; case BorderStyle.Inset: Elements.SetName("/S", "/I"); break; case BorderStyle.Underline: Elements.SetName("/S", "/U"); break; } }
public CStyleApplier TopBorder(BorderStyle borderStyle = BorderStyle.Thin) { BorderTop = borderStyle; return(this); }
public override string ToString() { return("Type:" + BorderStyle.ToString() + " Width:" + BorderWidth); }
/// <summary> /// 附加cellstyle样式 /// </summary> /// <param name="cellstyle"></param> /// <param name="workbook"></param> /// <param name="key"></param> /// <param name="value"></param> public static void AttachProperty(this ICellStyle cellstyle, IWorkbook workbook, string key, string value) { switch (key) { case "border": BorderStyle bs = value.ConvertToBorderStyle(); cellstyle.BorderTop = bs; cellstyle.BorderRight = bs; cellstyle.BorderBottom = bs; cellstyle.BorderLeft = bs; break; case "border-top": cellstyle.BorderTop = value.ConvertToBorderStyle(); //(BorderStyle)Enum.ToObject(typeof(BorderStyle), value); break; case "border-right": cellstyle.BorderRight = value.ConvertToBorderStyle(); //(BorderStyle)Enum.ToObject(typeof(BorderStyle), value); break; case "border-bottom": cellstyle.BorderBottom = value.ConvertToBorderStyle(); //(BorderStyle)Enum.ToObject(typeof(BorderStyle), value); break; case "border-left": cellstyle.BorderLeft = value.ConvertToBorderStyle(); //(BorderStyle)Enum.ToObject(typeof(BorderStyle), value); break; case "border-color": short xlcolor = GetXLColor((HSSFWorkbook)workbook, value); cellstyle.TopBorderColor = xlcolor; cellstyle.RightBorderColor = xlcolor; cellstyle.BottomBorderColor = xlcolor; cellstyle.LeftBorderColor = xlcolor; break; case "border-top-color": cellstyle.TopBorderColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "border-right-color": cellstyle.RightBorderColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "border-bottom-color": cellstyle.BottomBorderColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "border-left-color": cellstyle.LeftBorderColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "background-color": cellstyle.FillBackgroundColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "border-diagonal": break; case "border-diagonal-color": cellstyle.BorderDiagonalColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "border-diagonal-lines-tyle": break; case "color": cellstyle.FillForegroundColor = GetXLColor((HSSFWorkbook)workbook, value); break; case "pattern": cellstyle.FillPattern = value.ConvertToFillPattern(); break; case "data-format": break; case "vertical-align": cellstyle.VerticalAlignment = value.ConvertToVerticalAlignment(); break; case "text-align": cellstyle.Alignment = value.ConvertToHorizontalAlignment(); break; case "wraptext": cellstyle.WrapText = IsWrapText(value); break; } }
/// <summary> /// 构造方法 /// </summary> public ValidationCodeHelper() { _randomStringCount = 0; _border = BorderStyle.None; }
// Token: 0x06000305 RID: 773 RVA: 0x000033A8 File Offset: 0x000015A8 static void smethod_26(TextBoxBase textBoxBase_0, BorderStyle borderStyle_0) { textBoxBase_0.BorderStyle = borderStyle_0; }
public void setBorder(BorderStyle style) { xlFormatSetBorder(handle, (int)style); }
/// <summary> /// returns css "style=" tag for this control /// based on standard control visual properties /// </summary> private string CssStyle() { System.Text.StringBuilder functionReturnValue = new System.Text.StringBuilder(); string strColor; { functionReturnValue.Append(" style='"); if (BorderWidth.ToString().Length > 0) { functionReturnValue.Append("border-width:"); functionReturnValue.Append(BorderWidth.ToString()); functionReturnValue.Append(";"); } if (BorderStyle != System.Web.UI.WebControls.BorderStyle.NotSet) { functionReturnValue.Append("border-style:"); functionReturnValue.Append(BorderStyle.ToString()); functionReturnValue.Append(";"); } strColor = HtmlColor(BorderColor); if (strColor.Length > 0) { functionReturnValue.Append("border-color:"); functionReturnValue.Append(strColor); functionReturnValue.Append(";"); } strColor = HtmlColor(BackColor); if (strColor.Length > 0) { functionReturnValue.Append("background-color:" + strColor + ";"); } strColor = HtmlColor(ForeColor); if (strColor.Length > 0) { functionReturnValue.Append("color:" + strColor + ";"); } if (Font.Bold) { functionReturnValue.Append("font-weight:bold;"); } if (Font.Italic) { functionReturnValue.Append("font-style:italic;"); } if (Font.Underline) { functionReturnValue.Append("text-decoration:underline;"); } if (Font.Strikeout) { functionReturnValue.Append("text-decoration:line-through;"); } if (Font.Overline) { functionReturnValue.Append("text-decoration:overline;"); } if (Font.Size.ToString().Length > 0) { functionReturnValue.Append("font-size:" + Font.Size.ToString() + ";"); } if (Font.Names.Length > 0) { // string strFontFamily; functionReturnValue.Append("font-family:"); foreach (string strFontFamily in Font.Names) { functionReturnValue.Append(strFontFamily); functionReturnValue.Append(","); } functionReturnValue.Length = functionReturnValue.Length - 1; functionReturnValue.Append(";"); } if (Height.ToString() != "") { functionReturnValue.Append("height:" + Height.ToString() + ";"); } if (Width.ToString() != "") { functionReturnValue.Append("width:" + Width.ToString() + ";"); } functionReturnValue.Append("'"); } if (functionReturnValue.ToString() == " style=''") { return(""); } else { return(functionReturnValue.ToString()); } return(functionReturnValue.ToString()); }
public BaseLabel(ComponentResourceManager res, string name, int tabIndex = default, Point point = default, Size size = default, string text = default, Font font = default, bool autoSize = false, Padding padding = default, BorderStyle borderStyle = default) { Location = point; AutoSize = autoSize; Size = size; Margin = padding; Name = name; TabIndex = tabIndex; Text = text; Font = font; BorderStyle = borderStyle; res.ApplyResources(this, name); }
/// <summary> /// Sets the bottom border. /// </summary> /// <param name="cell">The cell.</param> /// <param name="borderBottom">The bottom border style.</param> /// <returns>A <seealso cref="FluentCell"/>, for further styling.</returns> public static FluentCell BorderBottom(this ICell cell, BorderStyle borderBottom) { return(new FluentCell(cell).BorderBottom(borderBottom)); }
/// <summary> /// Sets the diagonal border line style. /// </summary> /// <param name="cell">The cell.</param> /// <param name="borderDiagonalLineStyle">The diagonal border line style.</param> /// <returns>A <seealso cref="FluentCell"/>, for further styling.</returns> public static FluentCell BorderDiagonalLineStyle(this ICell cell, BorderStyle borderDiagonalLineStyle) { return(new FluentCell(cell).BorderDiagonalLineStyle(borderDiagonalLineStyle)); }
public abstract void CPDrawBorderStyle(Graphics dc, Rectangle area, BorderStyle border_style);
/// <summary> /// Sets the top border. /// </summary> /// <param name="cell">The cell.</param> /// <param name="borderTop">The top border style.</param> /// <returns>A <seealso cref="FluentCell"/>, for further styling.</returns> public static FluentCell BorderTop(this ICell cell, BorderStyle borderTop) { return(new FluentCell(cell).BorderTop(borderTop)); }
public int GetListViewBorderSize(BorderStyle borderStyle) { return(0); }
public void setBorders(string name, bool top, bool bottom, bool left, bool right, BorderStyle type) { if (bottom) { ExcelStyles[name].BorderBottom = type; } if (left) { ExcelStyles[name].BorderLeft = type; } if (right) { ExcelStyles[name].BorderRight = type; } if (top) { ExcelStyles[name].BorderTop = type; } }
/// <summary> /// Set the border of an <see cref="ExcelRange"/>. /// </summary> public static void SetBorder(this ExcelRange excelRange, BorderDirection borderDirection, BorderStyle borderStyle, Color borderColor) { _ = excelRange?.Style?.Border ?? throw new ArgumentException(ExceptionMessages.ExcelRangeNull); var mappedStyle = (OfficeOpenXml.Style.ExcelBorderStyle)borderStyle; switch (borderDirection) { case BorderDirection.Left: excelRange.Style.Border.Left.Style = mappedStyle; excelRange.Style.Border.Left.Color.SetColor(borderColor); break; case BorderDirection.Right: excelRange.Style.Border.Right.Style = mappedStyle; excelRange.Style.Border.Right.Color.SetColor(borderColor); break; case BorderDirection.Top: excelRange.Style.Border.Top.Style = mappedStyle; excelRange.Style.Border.Top.Color.SetColor(borderColor); break; case BorderDirection.Bottom: excelRange.Style.Border.Bottom.Style = mappedStyle; excelRange.Style.Border.Bottom.Color.SetColor(borderColor); break; case BorderDirection.Diagonal: excelRange.Style.Border.Diagonal.Style = mappedStyle; excelRange.Style.Border.Diagonal.Color.SetColor(borderColor); break; case BorderDirection.DiagonalUp: excelRange.Style.Border.Diagonal.Style = mappedStyle; excelRange.Style.Border.Diagonal.Color.SetColor(borderColor); excelRange.Style.Border.DiagonalUp = true; break; case BorderDirection.DiagonalDown: excelRange.Style.Border.Diagonal.Style = mappedStyle; excelRange.Style.Border.Diagonal.Color.SetColor(borderColor); excelRange.Style.Border.DiagonalDown = true; break; case BorderDirection.Around: excelRange.SetBorderAround(mappedStyle, borderColor); break; case BorderDirection.None: // No action. break; default: var exception = new InvalidOperationException(ExceptionMessages.UnknownBorderDirection); exception.Data.Add(nameof(borderDirection), borderDirection); throw exception; } }
public void setOuterBorder(BorderStyle style, float width) { setOuterBorder(style, width, new ColorDescriptor(0)); }
public BtnMy(Point p, Size s, string xt, Color bclr, Color fclr, Font fnt) { DoubleBuffered = true; Location = OriLoca = p; //new Size(s.Width * Cnst.Source.ZoomPerc / 100, s.Height * Cnst.Source.ZoomPerc / 100); Size = OriginSize = s; TextAlign = ContentAlignment.MiddleCenter; BackColor = bclr; ForeColor = fclr; Font = fnt; BrdrStyle = BorderStyle.None; Location = p; ShadeOwer.Size = Size = s; Text = xt; ShadeOwer.Location = new Point(0, 0); ShadeOwer.BackColor = Color.Transparent; ShadeOwer.SendToBack(); Controls.Add(ShadeOwer); if (FrLocked) { ToolTip hint = new ToolTip(); hint.SetToolTip(this, "Locked"); hint.BackColor = Color.Gray; hint.ForeColor = Color.OrangeRed; } else { ToolTip hint = new ToolTip(); hint.SetToolTip(this, "Movable"); hint.BackColor = Color.Gray; hint.ForeColor = Color.OrangeRed; } MouseDown += (sender, e) => { if (FrLocked) { mdFrameLoc = Location; mouseDownLoc = e.Location; } else { mouseDownLoc = e.Location; if (e.Button == MouseButtons.Left) { frameMoving = true; } BringToFront(); } }; MouseMove += (sender, e) => { if (frameMoving) { int left = Left + (e.X - mouseDownLoc.X); int top = Top + (e.Y - mouseDownLoc.Y); if (top < 0) { top = 0; } if (left < 0) { left = 0; } Top = top; Left = left; //OriLoca = new Point(left * 100 / Constants.Source.ZoomPerc, top * 100 / Constants.Source.ZoomPerc); } }; MouseUp += (sender, e) => { frameMoving = false; switch (e.Button) { case MouseButtons.Left: break; case MouseButtons.Middle: //Point parentLoc = new Point(parent.Left + Left + e.Location.X, parent.Top + Top + e.Location.Y); if (Location == mdFrameLoc) { } break; case MouseButtons.Right: //MessageBox.Show("A"); if (Location == mdFrameLoc) { } break; default: break; } }; BringToFront(); //myParent.Controls.Add(this); }
ThemeStyle(Color backColor, Color foreColor, BorderStyle borderStyle) { this.BackColor = backColor; this.ForeColor = foreColor; this.BorderStyle = borderStyle; }
protected override void FillStyleAttributes(CssStyleCollection attributes, IUrlResolutionService urlResolver) { // The style will be rendered on container elements that does not contain text directly. // It does not render font and forecolor. // Users should set font and forecolor on MenuItems styles. // Copying the code from the base class, except for the part that deals with Font and ForeColor. StateBag viewState = ViewState; Color c; // BackColor if (base.IsSet(PROP_BACKCOLOR)) { c = (Color)viewState["BackColor"]; if (!c.IsEmpty) { attributes.Add(HtmlTextWriterStyle.BackgroundColor, ColorTranslator.ToHtml(c)); } } // BorderColor if (base.IsSet(PROP_BORDERCOLOR)) { c = (Color)viewState["BorderColor"]; if (!c.IsEmpty) { attributes.Add(HtmlTextWriterStyle.BorderColor, ColorTranslator.ToHtml(c)); } } BorderStyle bs = this.BorderStyle; Unit bu = this.BorderWidth; if (!bu.IsEmpty) { attributes.Add(HtmlTextWriterStyle.BorderWidth, bu.ToString(CultureInfo.InvariantCulture)); if (bs == BorderStyle.NotSet) { if (bu.Value != 0.0) { attributes.Add(HtmlTextWriterStyle.BorderStyle, "solid"); } } else { attributes.Add(HtmlTextWriterStyle.BorderStyle, borderStyles[(int)bs]); } } else { if (bs != BorderStyle.NotSet) { attributes.Add(HtmlTextWriterStyle.BorderStyle, borderStyles[(int)bs]); } } Unit u; // Height if (base.IsSet(PROP_HEIGHT)) { u = (Unit)viewState["Height"]; if (!u.IsEmpty) { attributes.Add(HtmlTextWriterStyle.Height, u.ToString(CultureInfo.InvariantCulture)); } } // Width if (base.IsSet(PROP_WIDTH)) { u = (Unit)viewState["Width"]; if (!u.IsEmpty) { attributes.Add(HtmlTextWriterStyle.Width, u.ToString(CultureInfo.InvariantCulture)); } } if (!HorizontalPadding.IsEmpty || !VerticalPadding.IsEmpty) { attributes.Add(HtmlTextWriterStyle.Padding, string.Format(CultureInfo.InvariantCulture, "{0} {1} {0} {1}", VerticalPadding.IsEmpty ? Unit.Pixel(0) : VerticalPadding, HorizontalPadding.IsEmpty ? Unit.Pixel(0) : HorizontalPadding)); } }
/// <summary> /// 设置下边框样式 /// </summary> /// <param name="cellStyle">单元格样式</param> /// <param name="borderStyle">边框样式</param> public static ICellStyle SetBorderBottom(this ICellStyle cellStyle, BorderStyle borderStyle) { cellStyle.BorderBottom = borderStyle; return(cellStyle); }
/// <summary> /// Internal use only. /// Default constructor that sets border style to None. /// </summary> internal Border() { _style = BorderStyle.None; _width = 0.5F; _colorDesc = new ColorDescriptor(0); }
/// <summary> /// 设置右边框样式 /// </summary> /// <param name="cellStyle">单元格样式</param> /// <param name="borderStyle">边框样式</param> public static ICellStyle SetBorderRight(this ICellStyle cellStyle, BorderStyle borderStyle) { cellStyle.BorderRight = borderStyle; return(cellStyle); }
public CStyleApplier BottomBorder(BorderStyle borderStyle = BorderStyle.Thin) { BorderBottom = borderStyle; return(this); }
public void ApplyBorderStyle(BorderStyle value) { }
public void Panel_OnResize_InvokeWithDesignMode_CallsResize(bool resizeRedraw, BorderStyle borderStyle, EventArgs eventArgs, int expectedInvalidatedCallCount) { var mockSite = new Mock <ISite>(MockBehavior.Strict); mockSite .Setup(s => s.Container) .Returns((IContainer)null); mockSite .Setup(s => s.DesignMode) .Returns(true); mockSite .Setup(s => s.GetService(typeof(AmbientProperties))) .Returns(null); using var control = new SubPanel { Site = mockSite.Object, BorderStyle = borderStyle }; control.SetStyle(ControlStyles.ResizeRedraw, resizeRedraw); Assert.NotEqual(IntPtr.Zero, control.Handle); int callCount = 0; EventHandler handler = (sender, e) => { Assert.Same(control, sender); Assert.Same(eventArgs, e); callCount++; }; int layoutCallCount = 0; control.Layout += (sender, e) => { Assert.Same(control, sender); Assert.Same(control, e.AffectedControl); Assert.Equal("Bounds", e.AffectedProperty); layoutCallCount++; }; int invalidatedCallCount = 0; control.Invalidated += (sender, e) => invalidatedCallCount++; int styleChangedCallCount = 0; control.StyleChanged += (sender, e) => styleChangedCallCount++; int createdCallCount = 0; control.HandleCreated += (sender, e) => createdCallCount++; // Call with handler. control.Resize += handler; control.OnResize(eventArgs); Assert.Equal(1, callCount); Assert.Equal(1, layoutCallCount); Assert.True(control.IsHandleCreated); Assert.Equal(expectedInvalidatedCallCount, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); // Remove handler. control.Resize -= handler; control.OnResize(eventArgs); Assert.Equal(1, callCount); Assert.Equal(2, layoutCallCount); Assert.True(control.IsHandleCreated); Assert.Equal(expectedInvalidatedCallCount * 2, invalidatedCallCount); Assert.Equal(0, styleChangedCallCount); Assert.Equal(0, createdCallCount); }
public void DrawListViewBorder(Graphics g, Rectangle rc, BorderStyle borderStyle) { }
public void Panel_BorderStyle_SetInvalid_ThrowsInvalidEnumArgumentException(BorderStyle value) { var panel = new Panel(); Assert.Throws <InvalidEnumArgumentException>("value", () => panel.BorderStyle = value); }
/// <summary> /// Sets the right border. /// </summary> /// <param name="cell">The cell.</param> /// <param name="borderRight">The right border style.</param> /// <returns>A <seealso cref="FluentCell"/>, for further styling.</returns> public static FluentCell BorderRight(this ICell cell, BorderStyle borderRight) { return(new FluentCell(cell).BorderRight(borderRight)); }
/// <summary> /// 为行添加上边框 /// </summary> /// <param name="sheet"></param> /// <param name="startCell"></param> /// <param name="endCell"></param> private static void SetTopBorder(ref NPOIHelper2 sheet, int startCell = 0, int endCell = 0, BorderStyle borderStyle = BorderStyle.Thin, IFont font = null) { for (int i = startCell; i <= endCell; i++) { sheet.CreateCell(i, "", sheet.CellStyle(ha: HorizontalAlignment.Center, va: VerticalAlignment.Center, top: BorderStyle.Thin, font: font)); } }
public async override Task RenderAsync(TextWriter writer) { var tagName = "input"; if (TextMode == TextBoxMode.MultiLine) { tagName = "textarea"; } var tagBuilder = new TagBuilder(tagName) { TagRenderMode = TagRenderMode.SelfClosing }; tagBuilder.Attributes.Add("name", Name); switch (TextMode) { case TextBoxMode.SingleLine: tagBuilder.Attributes.Add("type", "text"); break; case TextBoxMode.MultiLine: if (Columns > 0) { tagBuilder.Attributes.Add("cols", Columns.ToString()); } if (Rows > 0) { tagBuilder.Attributes.Add("rows", Rows.ToString()); } break; case TextBoxMode.Password: tagBuilder.Attributes.Add("type", "password"); break; } tagBuilder.Attributes.Add("value", Text); if (!Visible) { tagBuilder.AddStyle( new Style { Attribute = "display", Value = "none" }); } if (BorderWidth > 0) { tagBuilder.AddStyle( new Style { Attribute = "border-width", Value = $"{BorderWidth}px" }); } if (BorderStyle > BorderStyle.None) { tagBuilder.AddStyle( new Style { Attribute = "border-style", Value = BorderStyle.ToString().ToLower() }); } if (!string.IsNullOrEmpty(BorderColor)) { tagBuilder.AddStyle( new Style { Attribute = "border-color", Value = BorderColor }); } if (!string.IsNullOrEmpty(BackColor)) { tagBuilder.AddStyle( new Style { Attribute = "background-color", Value = BackColor }); } if (!string.IsNullOrEmpty(ForeColor)) { tagBuilder.AddStyle( new Style { Attribute = "color", Value = ForeColor }); } if (!string.IsNullOrEmpty(CssClass)) { tagBuilder.AddCssClass(CssClass); } if (!Enabled) { tagBuilder.Attributes.Add("disabled", "disabled"); } if (Height > 0) { tagBuilder.AddStyle( new Style { Attribute = "hidth", Value = $"{Height}px" }); } if (Width > 0) { tagBuilder.AddStyle( new Style { Attribute = "width", Value = $"{Width}px" }); } if (!string.IsNullOrEmpty(ToolTip)) { tagBuilder.Attributes.Add("title", ToolTip); } if (Font != null) { if (!string.IsNullOrEmpty(Font.Name)) { tagBuilder.AddStyle( new Style { Attribute = "font-family", Value = Font.Name }); } if (Font.Size > 0) { tagBuilder.AddStyle( new Style { Attribute = "font-size", Value = $"{Font.Size}px" }); } if (Font.Bold) { tagBuilder.AddStyle( new Style { Attribute = "font-weight", Value = "bold" }); } if (Font.Italic) { tagBuilder.AddStyle( new Style { Attribute = "font-style", Value = "italic" }); } if (Font.Underline) { tagBuilder.AddStyle( new Style { Attribute = "text-decoration", Value = "underline" }); } if (Font.Stirkeout) { tagBuilder.AddStyle( new Style { Attribute = "text-decoration", Value = "line-throug" }); } } if (ReadOnly) { tagBuilder.Attributes.Add("readonly", "readonly"); } if (AutoPostBack) { tagBuilder.Attributes.Add("onchange", "this.form.submit()"); } tagBuilder.WriteTo(writer, HtmlEncoder.Default); await Task.CompletedTask; }