本文整理汇总了C#中System.Windows.Forms.TextBox.ResetText方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.ResetText方法的具体用法?C# TextBox.ResetText怎么用?C# TextBox.ResetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.ResetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayRegion
/*************
* AUX METHODS*
**************/
private void DisplayRegion(char[,] map, TextBox display)
{
display.ResetText();
for (int r = 0; r <= 14; r++)
{
for (int c = 0; c <= 14; c++)
{
if (map[r, c] == '#')
area++;
display.Text += map[r, c].ToString();
}
display.AppendText("\n");
}
}
示例2: _CreateRowView
//.........这里部分代码省略.........
AutoSize = true,
Dock = DockStyle.Fill,
MultiColumn = false,
Name = dc.ColumnName
};
checkedListBox.ItemCheck += _RowView_CheckedListBox_ItemCheck;
_specialControls.Add(dc.ColumnName, checkedListBox);
OutputAttribute attribute = ExcelFile.GetExcelAttribute(_dataFile.DataType.GetField(dc.ColumnName));
// Populate the checklist by either a enum or (less commonly) table indices
if (!String.IsNullOrEmpty(attribute.TableStringId))
{
// TODO: should perhaps use object delegator here, it might be faster
// so far its only its runtime is only 1n so doesnt really matter.
//
DataTable dataTable = _fileManager.GetDataTable(attribute.TableStringId);
foreach (DataRow row in dataTable.Rows)
{
checkedListBox.Items.Add(row[2], false);
}
}
else
{
Type cellType = dc.DataType;
foreach (Enum type in Enum.GetValues(cellType))
{
checkedListBox.Items.Add(type, false);
}
}
}
else if (dc.ExtendedProperties.ContainsKey(ExcelFile.ColumnTypeKeys.IsEnum) && (bool)dc.ExtendedProperties[ExcelFile.ColumnTypeKeys.IsEnum])
{
ComboBox comboBox = new ComboBox
{
Parent = _rows_LayoutPanel,
Dock = DockStyle.Fill,
Name = dc.ColumnName
};
// todo: consider lookomg into overloaded FindString or FindExactString methods and check (change) the startIndex parameter
Binding comboBoxBinding = comboBox.DataBindings.Add("SelectedIndex", _dataTable, dc.ColumnName, true);
comboBoxBinding.Format += _ComboBoxFormat;
comboBox.SelectedIndexChanged += _RowView_ComboList_ItemChange;
// need order as VALUE order - Enum.GetValues provides sorted as UNSIGNED values e.g. {0, 1, 2, 3, -3, -2, -1} instead of {-3, -2, -1, 0, 1, 2, 3}
List<Enum> enumValues = Enum.GetValues(dc.DataType).Cast<Enum>().ToList();
enumValues.Sort(); // List sort works as SIGNED
comboBox.Items.AddRange(enumValues.ToArray());
comboBox.Tag = Math.Abs(Convert.ToInt32(enumValues.Min())); // we need a minimum value to get our base offset
}
else
{
TextBox textBox = new TextBox
{
Text = String.Empty,
Parent = _rows_LayoutPanel,
AutoSize = true,
Dock = DockStyle.Fill,
Name = dc.ColumnName
};
textBox.DataBindings.Add("Text", _dataTable, dc.ColumnName);
if ((dc.ExtendedProperties.ContainsKey(ExcelFile.ColumnTypeKeys.IsRelationGenerated) && (bool)dc.ExtendedProperties[ExcelFile.ColumnTypeKeys.IsRelationGenerated]) || column == 0)
{
textBox.ReadOnly = true;
if (relationTextBox != null)
{
relationTextBox.TextChanged += (sender, e) => textBox.ResetText();
}
}
if ((dc.ExtendedProperties.ContainsKey(ExcelFile.ColumnTypeKeys.IsStringIndex) && (bool)dc.ExtendedProperties[ExcelFile.ColumnTypeKeys.IsStringIndex]) ||
(dc.ExtendedProperties.ContainsKey(ExcelFile.ColumnTypeKeys.IsStringOffset) && (bool)dc.ExtendedProperties[ExcelFile.ColumnTypeKeys.IsStringOffset]))
{
relationTextBox = textBox;
}
else
{
relationTextBox = null;
}
}
}
new Label
{
Text = String.Empty,
Parent = _rows_LayoutPanel,
AutoSize = true,
Dock = DockStyle.Fill
};
_rows_LayoutPanel.ResumeLayout();
_rows_LayoutPanel.Width += 10;
// fixes mouse scroll wheel
// todo: this is dodgy and causes focused elements within the layoutpanel to lose focus (e.g. a text box) - rather anoying
_rows_LayoutPanel.Click += (sender, e) => _rows_LayoutPanel.Focus();
_rows_LayoutPanel.MouseEnter += (sender, e) => _rows_LayoutPanel.Focus();
}
示例3: SetAllMentionToTextBox
public static void SetAllMentionToTextBox(TextBox tb, ListViewItem item, ref TwitterModelClass tmc)
{
TwitterStatus status = (TwitterStatus)item.Tag;
tb.Tag = item;
tb.ResetText();
List<string> screenNameList = new List<string>();
screenNameList.Add(status.User.ScreenName);
foreach (TwitterMention tm in status.Entities.Mentions)
{
screenNameList.Add(tm.ScreenName);
}
string MySName = tmc.MySName;
screenNameList.RemoveAll((s => s == MySName));
foreach (string sname in screenNameList)
{
tb.Text = tb.Text + "@" + sname + " ";
}
tb.Focus();
tb.Select(tb.TextLength, 0);
}