本文整理汇总了C#中AnchorStyles类的典型用法代码示例。如果您正苦于以下问题:C# AnchorStyles类的具体用法?C# AnchorStyles怎么用?C# AnchorStyles使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnchorStyles类属于命名空间,在下文中一共展示了AnchorStyles类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hide_LocationChanged
private void hide_LocationChanged(object sender, EventArgs e)
{
if (this.Top <= 0 && this.Left <= 0)
{
StopAanhor = AnchorStyles.None;
}
else if (this.Top <= 0)
{
StopAanhor = AnchorStyles.Top;
}
else if (this.Left <= 0)
{
StopAanhor = AnchorStyles.Left;
}
else if (this.Left >= Screen.PrimaryScreen.Bounds.Width - this.Width)
{
StopAanhor = AnchorStyles.Right;
}
else if (this.Top >= Screen.PrimaryScreen.Bounds.Height - this.Height)
{
StopAanhor = AnchorStyles.Bottom;
}
else
{
StopAanhor = AnchorStyles.None;
}
}
示例2: CreateAI
public static IAIPlayer CreateAI(
IAILogicProvider logicProvider,
string name,
int chips,
Label statusLabel,
TextBox chipsTextBox,
AnchorStyles cardHoldersPictureBoxesAnchorStyles,
int cardHoldersPictureBoxesX,
int cardHoldersPictureBoxesY)
{
IList<PictureBox> cardHolders = GetCardHoldersPictureBoxes(cardHoldersPictureBoxesAnchorStyles,
cardHoldersPictureBoxesX, cardHoldersPictureBoxesY);
Panel panel = GetPlayerPanel(cardHolders);
chipsTextBox.Enabled = false;
return new AI(
currentPlayerId,
name,
statusLabel,
chipsTextBox,
chips,
cardHolders,
panel,
logicProvider);
}
示例3: CreateTutorialArrowWindow
public static void CreateTutorialArrowWindow(bool upArrow, Point offset, AnchorStyles anchor, Form parentWindow)
{
bool doShow = false;
TutorialArrowWindow window = InterfaceMgr.Instance.getTutorialArrowWindow();
if (window == null)
{
window = new TutorialArrowWindow();
doShow = true;
}
else
{
if (parentWindow != lastParent)
{
window.Close();
window = new TutorialArrowWindow();
doShow = true;
}
if (!window.Created || !window.Visible)
{
doShow = true;
}
}
if ((window != null) && ((doShow || (offset != window.m_offset)) || (anchor != window.m_anchor)))
{
lastParent = parentWindow;
window.show(upArrow, offset, anchor);
window.updateLocation(parentWindow);
window.showTutorialArrowWindow(doShow, parentWindow);
}
}
示例4: ToolTab
public ToolTab(Tool tool, AnchorStyles anchor, Orientation orientation)
{
if(tool == null) throw new ArgumentNullException("tool");
_tool = tool;
_anchor = anchor;
_orientation = orientation;
}
示例5: AttachTo
public void AttachTo(Rectangle r, int padding, AnchorStyles defaultArrowAnchor)
{
attachedRect = r;
attachedTo = null;
attachedBoundary = null;
attachedPadding = padding;
this.defaultArrowAnchor = defaultArrowAnchor;
OnAttachedLocationChanged();
}
示例6: IUILayoutParam
public IUILayoutParam(AnchorStyles anchorStyle, Padding padding, System.Drawing.Size size,
int zNear = -1000, int zFar = 1000)
{
// TODO: Complete member initialization
this.Anchor = anchorStyle;
this.Margin = padding;
this.Size = size;
this.zNear = zNear;
this.zFar = zFar;
}
示例7: DoIt
public static void DoIt(QuickGrid grid,
PictureBox picture,Control parent,
AnchorStyles anchor)
{
picture.Visible = false;
grid.Location = picture.Location;
grid.Visible = true;
grid.Size = picture.Size;
grid.Dock = picture.Dock;
grid.Parent = parent;
grid.Anchor = anchor;
}
示例8: CustomWitIconButton
public CustomWitIconButton(Image iconImage, AnchorStyles style, Color color,String toolTipText) {
Size = new System.Drawing.Size(25, 28);
Anchor = style;
FlatStyle = FlatStyle.Flat;
BackColor = color;
FlatAppearance.BorderColor = color;
Image = iconImage;
ToolTip textMailToolTip = new ToolTip();
textMailToolTip.SetToolTip(this, toolTipText);
}
示例9: GetCardHoldersPictureBoxes
private static IList<PictureBox> GetCardHoldersPictureBoxes(
AnchorStyles cardHoldersPictureBoxesAnchorStyles,
int cardHoldersPictureBoxesX,
int cardHoldersPictureBoxesY)
{
IList<PictureBox> cardHolders = new List<PictureBox>();
cardHolders.Add(CreatePictureBox(cardHoldersPictureBoxesAnchorStyles, cardHoldersPictureBoxesX, cardHoldersPictureBoxesY));
cardHoldersPictureBoxesX += cardHolders.First().Width;
cardHolders.Add(CreatePictureBox(cardHoldersPictureBoxesAnchorStyles, cardHoldersPictureBoxesX, cardHoldersPictureBoxesY));
return cardHolders;
}
示例10: Control
private int gnzIndex;//对象的Z轴深度
public Control() {
//gMouseOn = false;
base.RefreshAllow = false;
gVisible = true;
gbAbsolute = false;
gAnchor = AnchorStyles.Left | AnchorStyles.Top;
gnRight = 0;
gnBottom = 0;
gbAnchorCache = false;
gnzIndex = 0;
base.RefreshAllow = true;
}
示例11: add_DataGridView
public static DataGridView add_DataGridView(Control cTargetControl,
int iLeft, int iTop, int iWidth, int iHeight,
AnchorStyles asAnchorStyles)
{
var dgvDataGridView = new DataGridView();
dgvDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgvDataGridView.Anchor = asAnchorStyles;
dgvDataGridView.Height = iHeight;
dgvDataGridView.Width = iWidth;
dgvDataGridView.Left = iLeft;
dgvDataGridView.Top = iTop;
// dgvDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
cTargetControl.Controls.Add(dgvDataGridView);
return dgvDataGridView;
}
示例12: CreateCharacter
public Character CreateCharacter(
string characterType,
string name,
int chips,
Label status,
TextBox textBox,
AnchorStyles cardHolderAnchorStyles,
int pictureBoxX,
int pictureBoxY)
{
IList<PictureBox> cardHolders = new List<PictureBox>();
cardHolders.Add(CreatePictureBox(cardHolderAnchorStyles, pictureBoxX, pictureBoxY));
pictureBoxX += cardHolders.First().Width;
cardHolders.Add(CreatePictureBox(cardHolderAnchorStyles, pictureBoxX, pictureBoxY));
Panel panel = new Panel();
panel.Location = new Point(cardHolders.First().Left - 10, cardHolders.Last().Top - 10);
panel.BackColor = Color.DarkBlue;
panel.Height = 150;
panel.Width = 180;
panel.Visible = false;
textBox.Enabled = false;
switch (characterType)
{
case "Player":
return new Player(
characterId,
name,
status,
textBox,
chips,
cardHolders,
panel);
case "Bot":
return new Bot(
characterId,
name,
status,
textBox,
chips,
cardHolders,
panel);
default:
throw new PlayerTypeNotImplementedException("");
}
}
示例13: Mirror
static AnchorStyles Mirror(AnchorStyles anchor)
{
bool right = (anchor & AnchorStyles.Right) == AnchorStyles.Right;
bool left = (anchor & AnchorStyles.Left ) == AnchorStyles.Left ;
if (right) {
anchor = anchor | AnchorStyles.Left;
} else {
anchor = anchor & ~AnchorStyles.Left;
}
if (left) {
anchor = anchor | AnchorStyles.Right;
} else {
anchor = anchor & ~AnchorStyles.Right;
}
return anchor;
}
示例14: formAccountTooltip
public formAccountTooltip()
{
InitializeComponent();
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.UserPaint, true);
brush = new SolidBrush(Color.Black);
pen = new Pen(brush);
this.BackColor = Color.White;
this.TransparencyKey = Color.Red;
arrowAnchor = AnchorStyles.Left;
}
示例15: CreatePictureBox
private static PictureBox CreatePictureBox(
AnchorStyles cardHoldersPictureBoxesAnchorStyles,
int cardHoldersPictureBoxesX,
int cardHoldersPictureBoxesY)
{
PictureBox cardHolder = new PictureBox();
cardHolder.SizeMode = PictureBoxSizeMode.StretchImage;
cardHolder.Height = 130;
cardHolder.Width = 80;
cardHolder.Visible = false;
cardHolder.Name = "pb" + charactersCount++;
cardHolder.Anchor = cardHoldersPictureBoxesAnchorStyles;
cardHolder.Location = new Point(cardHoldersPictureBoxesX, cardHoldersPictureBoxesY);
return cardHolder;
}