本文整理汇总了C#中BorderStyle类的典型用法代码示例。如果您正苦于以下问题:C# BorderStyle类的具体用法?C# BorderStyle怎么用?C# BorderStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BorderStyle类属于命名空间,在下文中一共展示了BorderStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CreateBorderedCircle
/// <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;
}
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:58,代码来源:Shape.cs
示例17: CrtPanel
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);
}
开发者ID:HolodeckOne,项目名称:RMLib,代码行数:11,代码来源:CrtPanel.cs
示例18: ProgramSettings
public ProgramSettings(string file, string NiceName)
{
Filepath = file;
FileName = NiceName;
//Some defaults
Borderstyle = BorderStyle.SIZABLE;
WindowState = WinState.NORMAL;
Style = 382664704;
Enabled = false;
}
开发者ID:Foohy,项目名称:WindowManager,代码行数:12,代码来源:ProgramSettings.cs
示例19: SetUpFixture
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;
}
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:14,代码来源:LineTestFixture.cs
示例20: GetBorderWidth
// 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;
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:15,代码来源:DefaultThemePainter.cs
注:本文中的BorderStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论