本文整理汇总了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]=' ';
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
示例6: Border
public Border(BorderStyle tcbs, BorderSize size, int space, Color color)
{
this.Tcbs = tcbs;
this.Size = size;
this.Space = space;
this.Color = color;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例11: BorderLayer
public BorderLayer(String name, int width, BorderStyle style, Color color)
: base(name, SolidColours.White)
{
borderWidth = width;
borderStyle = style;
borderColour = color;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}