本文整理汇总了C#中Client.MirControls.MirTextBox.SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C# MirTextBox.SetFocus方法的具体用法?C# MirTextBox.SetFocus怎么用?C# MirTextBox.SetFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client.MirControls.MirTextBox
的用法示例。
在下文中一共展示了MirTextBox.SetFocus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MirInputBox
public MirInputBox(string message)
{
Modal = true;
Movable = false;
Index = 660;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
CaptionLabel = new MirLabel
{
DrawFormat = TextFormatFlags.WordBreak,
Location = new Point(25, 25),
Size = new Size(235, 40),
Parent = this,
Text = message,
};
InputTextBox = new MirTextBox
{
Parent = this,
Border = true,
BorderColour = Color.Lime,
Location = new Point(23, 86),
Size = new Size(240, 19),
MaxLength = 50,
};
InputTextBox.SetFocus();
InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress;
OKButton = new MirButton
{
HoverIndex = 201,
Index = 200,
Library = Libraries.Title,
Location = new Point(60, 123),
Parent = this,
PressedIndex = 202,
};
CancelButton = new MirButton
{
HoverIndex = 204,
Index = 203,
Library = Libraries.Title,
Location = new Point(160, 123),
Parent = this,
PressedIndex = 205,
};
CancelButton.Click += DisposeDialog;
}
示例2: NewCharacterDialog
public NewCharacterDialog()
{
Index = 73;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width)/2, (Settings.ScreenHeight - Size.Height)/2);
Modal = true;
TitleLabel = new MirImageControl
{
Index = 20,
Library = Libraries.Title,
Location = new Point(206, 11),
Parent = this,
};
CancelButton = new MirButton
{
HoverIndex = 281,
Index = 280,
Library = Libraries.Title,
Location = new Point(425, 425),
Parent = this,
PressedIndex = 282
};
CancelButton.Click += (o, e) => Dispose();
OKButton = new MirButton
{
Enabled = false,
HoverIndex = 361,
Index = 360,
Library = Libraries.Title,
Location = new Point(160, 425),
Parent = this,
PressedIndex = 362,
};
OKButton.Click += (o, e) => CreateCharacter();
NameTextBox = new MirTextBox
{
Location = new Point(325, 268),
Parent = this,
Size = new Size(240, 20),
MaxLength = Globals.MaxCharacterNameLength
};
NameTextBox.TextBox.KeyPress += TextBox_KeyPress;
NameTextBox.TextBox.TextChanged += CharacterNameTextBox_TextChanged;
NameTextBox.SetFocus();
CharacterDisplay = new MirAnimatedControl
{
Animated = true,
AnimationCount = 16,
AnimationDelay = 250,
Index = 20,
Library = Libraries.ChrSel,
Location = new Point(120, 250),
Parent = this,
UseOffSet = true,
};
CharacterDisplay.AfterDraw += (o, e) =>
{
if (_class == MirClass.Wizard)
Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true);
};
WarriorButton = new MirButton
{
HoverIndex = 2427,
Index = 2427,
Library = Libraries.Prguse,
Location = new Point(323, 296),
Parent = this,
PressedIndex = 2428,
Sound = SoundList.ButtonA,
};
WarriorButton.Click += (o, e) =>
{
_class = MirClass.Warrior;
UpdateInterface();
};
WizardButton = new MirButton
{
HoverIndex = 2430,
Index = 2429,
Library = Libraries.Prguse,
Location = new Point(373, 296),
Parent = this,
PressedIndex = 2431,
Sound = SoundList.ButtonA,
};
WizardButton.Click += (o, e) =>
{
_class = MirClass.Wizard;
UpdateInterface();
};
//.........这里部分代码省略.........
示例3: LoginDialog
public LoginDialog()
{
Index = 1084;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width)/2, (Settings.ScreenHeight - Size.Height)/2);
TitleLabel = new MirImageControl
{
Index = 30,
Library = Libraries.Title,
Parent = this,
};
TitleLabel.Location = new Point((Size.Width - TitleLabel.Size.Width)/2, 5);
AccountIDLabel = new MirImageControl
{
Index = 31,
Library = Libraries.Title,
Parent = this,
Location = new Point(51, 82),
};
PassLabel = new MirImageControl
{
Index = 32,
Library = Libraries.Title,
Parent = this,
Location = new Point(46, 109)
};
OKButton = new MirButton
{
Enabled = false,
HoverIndex = 321,
Index = 320,
Library = Libraries.Title,
Location = new Point(227, 83),
Parent = this,
PressedIndex = 322
};
OKButton.Click += (o, e) => Login();
AccountButton = new MirButton
{
HoverIndex = 324,
Index = 323,
Library = Libraries.Title,
Location = new Point(60, 163),
Parent = this,
PressedIndex = 325,
};
PassButton = new MirButton
{
HoverIndex = 327,
Index = 326,
Library = Libraries.Title,
Location = new Point(166, 163),
Parent = this,
PressedIndex = 328,
};
ViewKeyButton = new MirButton
{
HoverIndex = 333,
Index = 332,
Library = Libraries.Title,
Location = new Point(60, 189),
Parent = this,
PressedIndex = 334,
};
CloseButton = new MirButton
{
HoverIndex = 330,
Index = 329,
Library = Libraries.Title,
Location = new Point(166, 189),
Parent = this,
PressedIndex = 331,
};
CloseButton.Click += (o, e) => Program.Form.Close();
AccountIDTextBox = new MirTextBox
{
Location = new Point(85, 85),
Parent = this,
Size = new Size(136, 15),
MaxLength = Globals.MaxAccountIDLength
};
AccountIDTextBox.SetFocus();
AccountIDTextBox.TextBox.TextChanged += AccountIDTextBox_TextChanged;
AccountIDTextBox.TextBox.KeyPress += TextBox_KeyPress;
AccountIDTextBox.Text = Settings.AccountID;
PasswordTextBox = new MirTextBox
{
Location = new Point(85, 108),
Parent = this,
Password = true,
//.........这里部分代码省略.........
示例4: ChangePasswordDialog
public ChangePasswordDialog()
{
Index = 50;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
CancelButton = new MirButton
{
HoverIndex = 111,
Index = 110,
Library = Libraries.Title,
Location = new Point(222, 236),
Parent = this,
PressedIndex = 112
};
CancelButton.Click += (o, e) => Dispose();
OKButton = new MirButton
{
Enabled = false,
HoverIndex = 108,
Index = 107,
Library = Libraries.Title,
Location = new Point(80, 236),
Parent = this,
PressedIndex = 109,
};
OKButton.Click += (o, e) => ChangePassword();
AccountIDTextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(178, 76),
MaxLength = Globals.MaxAccountIDLength,
Parent = this,
Size = new Size(136, 18),
};
AccountIDTextBox.SetFocus();
AccountIDTextBox.TextBox.MaxLength = Globals.MaxAccountIDLength;
AccountIDTextBox.TextBox.TextChanged += AccountIDTextBox_TextChanged;
CurrentPasswordTextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(178, 114),
MaxLength = Globals.MaxPasswordLength,
Parent = this,
Password = true,
Size = new Size(136, 18),
TextBox = { MaxLength = Globals.MaxPasswordLength },
};
CurrentPasswordTextBox.TextBox.TextChanged += CurrentPasswordTextBox_TextChanged;
NewPassword1TextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(178, 152),
MaxLength = Globals.MaxPasswordLength,
Parent = this,
Password = true,
Size = new Size(136, 18),
TextBox = { MaxLength = Globals.MaxPasswordLength },
};
NewPassword1TextBox.TextBox.TextChanged += NewPassword1TextBox_TextChanged;
NewPassword2TextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(178, 189),
MaxLength = Globals.MaxPasswordLength,
Parent = this,
Password = true,
Size = new Size(136, 18),
TextBox = { MaxLength = Globals.MaxPasswordLength },
};
NewPassword2TextBox.TextBox.TextChanged += NewPassword2TextBox_TextChanged;
}
示例5: NewAccountDialog
public NewAccountDialog()
{
Index = 63;
Library = Libraries.Prguse;
Size = new Size();
Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
CancelButton = new MirButton
{
HoverIndex = 204,
Index = 203,
Library = Libraries.Title,
Location = new Point(409, 425),
Parent = this,
PressedIndex = 205
};
CancelButton.Click += (o, e) => Dispose();
OKButton = new MirButton
{
Enabled = false,
HoverIndex = 201,
Index = 200,
Library = Libraries.Title,
Location = new Point(135, 425),
Parent = this,
PressedIndex = 202,
};
OKButton.Click += (o, e) => CreateAccount();
AccountIDTextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(226, 104),
MaxLength = Globals.MaxAccountIDLength,
Parent = this,
Size = new Size(136, 18),
};
AccountIDTextBox.SetFocus();
AccountIDTextBox.TextBox.MaxLength = Globals.MaxAccountIDLength;
AccountIDTextBox.TextBox.TextChanged += AccountIDTextBox_TextChanged;
AccountIDTextBox.TextBox.GotFocus += AccountIDTextBox_GotFocus;
Password1TextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(226, 130),
MaxLength = Globals.MaxPasswordLength,
Parent = this,
Password = true,
Size = new Size(136, 18),
TextBox = { MaxLength = Globals.MaxPasswordLength },
};
Password1TextBox.TextBox.TextChanged += Password1TextBox_TextChanged;
Password1TextBox.TextBox.GotFocus += PasswordTextBox_GotFocus;
Password2TextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(226, 156),
MaxLength = Globals.MaxPasswordLength,
Parent = this,
Password = true,
Size = new Size(136, 18),
TextBox = { MaxLength = Globals.MaxPasswordLength },
};
Password2TextBox.TextBox.TextChanged += Password2TextBox_TextChanged;
Password2TextBox.TextBox.GotFocus += PasswordTextBox_GotFocus;
UserNameTextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(226, 190),
MaxLength = 20,
Parent = this,
Size = new Size(136, 18),
TextBox = { MaxLength = 20 },
};
UserNameTextBox.TextBox.TextChanged += UserNameTextBox_TextChanged;
UserNameTextBox.TextBox.GotFocus += UserNameTextBox_GotFocus;
BirthDateTextBox = new MirTextBox
{
Border = true,
BorderColour = Color.Gray,
Location = new Point(226, 216),
MaxLength = 10,
Parent = this,
Size = new Size(136, 18),
TextBox = { MaxLength = 10 },
};
BirthDateTextBox.TextBox.TextChanged += BirthDateTextBox_TextChanged;
BirthDateTextBox.TextBox.GotFocus += BirthDateTextBox_GotFocus;
QuestionTextBox = new MirTextBox
{
//.........这里部分代码省略.........
示例6: MirAmountBox
public MirAmountBox(string title, int image, uint max, uint min = 0, uint defaultAmount = 0)
{
ImageIndex = image;
MaxAmount = max;
MinAmount = min;
Amount = max;
Modal = true;
Movable = false;
Index = 238;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
TitleLabel = new MirLabel
{
AutoSize = true,
Location = new Point(19, 8),
Parent = this,
NotControl = true,
Text = title
};
CloseButton = new MirButton
{
HoverIndex = 361,
Index = 360,
Location = new Point(180, 3),
Library = Libraries.Prguse2,
Parent = this,
PressedIndex = 362,
Sound = SoundList.ButtonA,
};
CloseButton.Click += (o, e) => Dispose();
ItemImage = new MirControl
{
Location = new Point(15, 34),
Size = new Size(38, 34),
Parent = this,
};
ItemImage.AfterDraw += (o, e) => DrawItem();
OKButton = new MirButton
{
HoverIndex = 201,
Index = 200,
Library = Libraries.Title,
Location = new Point(23, 76),
Parent = this,
PressedIndex = 202,
};
OKButton.Click += (o, e) => Dispose();
CancelButton = new MirButton
{
HoverIndex = 204,
Index = 203,
Library = Libraries.Title,
Location = new Point(110, 76),
Parent = this,
PressedIndex = 205,
};
CancelButton.Click += (o, e) => Dispose();
InputTextBox = new MirTextBox
{
Parent = this,
Border = true,
BorderColour = Color.Lime,
Location = new Point(58, 43),
Size = new Size(132, 19),
};
InputTextBox.SetFocus();
InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress;
InputTextBox.TextBox.TextChanged += TextBox_TextChanged;
InputTextBox.Text = (defaultAmount > 0 && defaultAmount <= MaxAmount) ? defaultAmount.ToString() : MaxAmount.ToString();
InputTextBox.TextBox.SelectionStart = 0;
InputTextBox.TextBox.SelectionLength = InputTextBox.Text.Length;
}