本文整理汇总了C#中System.Windows.Forms.MaskedTextBox.MaskFull属性的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextBox.MaskFull属性的具体用法?C# MaskedTextBox.MaskFull怎么用?C# MaskedTextBox.MaskFull使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.MaskedTextBox
的用法示例。
在下文中一共展示了MaskedTextBox.MaskFull属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
maskedTextBox1.Mask = "00/00/0000";
maskedTextBox1.MaskInputRejected += new MaskInputRejectedEventHandler(maskedTextBox1_MaskInputRejected);
maskedTextBox1.KeyDown += new KeyEventHandler(maskedTextBox1_KeyDown);
}
void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
{
if (maskedTextBox1.MaskFull)
{
toolTip1.ToolTipTitle = "Input Rejected - Too Much Data";
toolTip1.Show("You cannot enter any more data into the date field. Delete some characters in order to insert more data.", maskedTextBox1, 0, -20, 5000);
}
else if (e.Position == maskedTextBox1.Mask.Length)
{
toolTip1.ToolTipTitle = "Input Rejected - End of Field";
toolTip1.Show("You cannot add extra characters to the end of this date field.", maskedTextBox1, 0, -20, 5000);
}
else
{
toolTip1.ToolTipTitle = "Input Rejected";
toolTip1.Show("You can only add numeric characters (0-9) into this date field.", maskedTextBox1, 0, -20, 5000);
}
}
void maskedTextBox1_KeyDown(object sender, KeyEventArgs e)
{
// The balloon tip is visible for five seconds; if the user types any data before it disappears, collapse it ourselves.
toolTip1.Hide(maskedTextBox1);
}