本文整理汇总了C#中System.Windows.Forms.MaskedTextBox.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextBox.BringToFront方法的具体用法?C# MaskedTextBox.BringToFront怎么用?C# MaskedTextBox.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.MaskedTextBox
的用法示例。
在下文中一共展示了MaskedTextBox.BringToFront方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadControls
/// <summary>
/// Loads controls on the panel
/// </summary>
private void LoadControls()
{
foreach (SearchListBoxItem item in searchFieldsCollection)
{
//add masked textbox or textbox to the panel
if (!string.IsNullOrEmpty(item.Pattern))
{
//Add masked textbox to the panel
MaskedTextBox fieldTextBox = new MaskedTextBox();
fieldTextBox.Location = new System.Drawing.Point(300, textLinePosition);
fieldTextBox.Size = new System.Drawing.Size(286, 20);
fieldTextBox.BringToFront();
fieldTextBox.Leave += new EventHandler(fieldTextBox_Leave);
// fieldTextBox.MaskInputRejected += new MaskInputRejectedEventHandler(maskedTextBox_MaskInputRejected);
string mask = AppData.Instance.DataPatternsDataTable.GetMaskByPattern(item.Pattern);
//fieldTextBox.Mask = AppData.Instance.DataPatternsDataTable.GetExpressionByMask(mask, item.Pattern);
fieldTextBox.Tag = item.Type;
fieldTextBox.Name = item.Name;
//fieldTextBox.Mask = mask;
if (item.Type.Equals("Number") || item.Type.Equals("PhoneNumber"))
{
// fieldTextBox.PromptChar = '_';
}
else if (item.Type.Equals("Date") || item.Type.Equals("DateTime"))
{
// fieldTextBox.PromptChar = '_';
fieldTextBox.Text = String.Format("{0}", string.Empty);
}
else if (item.Type.Equals("Time"))
{
// fieldTextBox.PromptChar = '_';
fieldTextBox.Text = String.Format("{0:T}", string.Empty);
}
splitContainer1.Panel2.Controls.Add(fieldTextBox);
textLinePosition += 38;
if (myControlDictionaryData.ContainsKey(item.Name.ToString()))
{
fieldTextBox.Text = myControlDictionaryData[item.Name.ToString()].ToString();
}
myControlDictionary.Add(item.Name.ToString(), fieldTextBox);
myControlItemDictionary.Add(fieldTextBox, item);
fieldTextBox.Focus();
}
else
{
//if (item.Type.Equals("YesNo"))
//{
// ComboBox cbxYesNo = new ComboBox();
// Configuration config = Configuration.GetNewInstance();
// cbxYesNo.Items.AddRange(new object[] { config.Settings.RepresentationOfYes, config.Settings.RepresentationOfNo, config.Settings.RepresentationOfMissing });
// cbxYesNo.Location = new System.Drawing.Point(300, textLinePosition);
// cbxYesNo.Size = new System.Drawing.Size(286, 20);
// cbxYesNo.BringToFront();
// cbxYesNo.Leave += new EventHandler(fieldTextBox_Leave);
// splitContainer1.Panel2.Controls.Add(cbxYesNo);
// textLinePosition += 38;
// myControlDictionary.Add(item.Name.ToString(), cbxYesNo);
// myControlItemDictionary.Add(cbxYesNo, item);
// cbxYesNo.Focus();
//}
//else
{
////add textbox to panel
TextBox fieldTextBox = new TextBox();
fieldTextBox.Name = item.Name;
fieldTextBox.Location = new System.Drawing.Point(300, textLinePosition);
fieldTextBox.Size = new System.Drawing.Size(286, 20);
fieldTextBox.BringToFront();
fieldTextBox.Leave += new EventHandler(fieldTextBox_Leave);
splitContainer1.Panel2.Controls.Add(fieldTextBox);
textLinePosition += 38;
myControlDictionary.Add(item.Name.ToString(), fieldTextBox);
myControlItemDictionary.Add(fieldTextBox, item);
fieldTextBox.Focus();
}
}
//add field name label to panel
Label fieldName = new Label();
fieldName.Tag = item.Name.ToString().ToUpper();
fieldName.Location = new System.Drawing.Point(26, labelLinePosition);
fieldName.Size = new System.Drawing.Size(35, 13);
fieldName.AutoSize = true;
fieldName.FlatStyle = FlatStyle.System;
fieldName.Text = item.Name.ToString();
splitContainer1.Panel2.Controls.Add(fieldName);
labelLinePosition += 38;
//add pattern label to panel
Label lblPattern = new Label();
//.........这里部分代码省略.........
示例2: setupDefFillIns
void setupDefFillIns(int learningPhase)
{
string[] defs = getLineDefs();
mtbDefs = new List<MaskedTextBox>();
int top = lblDef.Top;
for (int i = 0; i < defs.Length; i++)
{
MaskedTextBox mtbDef = new MaskedTextBox();
mtbDef.Left = lblDef.Left - 20;
mtbDef.Top = top;
mtbDef.Width = this.Width - 60;
mtbDef.Font = lblDef.Font;
mtbDef.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
mtbDef.TabIndex = i;
mtbDef.Click += new EventHandler(mtbDef_Enter);
mtbDef.GotFocus += new EventHandler(mtbDef_Enter);
mtbDef.KeyPress += new KeyPressEventHandler(mtbDef_KeyPress);
mtbDef.KeyUp += new KeyEventHandler(mtbDef_KeyUp);
mtbDef.Tag = defs[i];
panelDef.Controls.Add(mtbDef);
mtbDefs.Add(mtbDef);
mtbDef.BringToFront();
top += mtbDef.Height + 8;
}
kwBounds = new List<List<Tuple<int, int>>>();
for (int i = 0; i < defs.Length; i++)
{
kwBounds.Add(new List<Tuple<int, int>>());
kwBounds[i] = Misc.GetKeywordBounds(testWord.ToString(), defs[i], corewords);
int toRemove = 0;
switch (learningPhase)
{
case 4:
toRemove = kwBounds[i].Count - 1;
break;
case 5:
toRemove = kwBounds[i].Count / 2;
break;
case 6:
//remove none
break;
}
for (int j = 0; j < toRemove; j++)
kwBounds[i].RemoveAt(rand.Next(kwBounds[i].Count));
}
dispDefs();
}