本文整理汇总了C#中System.Windows.Controls.TextChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TextChangedEventArgs类的具体用法?C# TextChangedEventArgs怎么用?C# TextChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextChangedEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了TextChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkValid
private void checkValid(object sender, TextChangedEventArgs e)
{
bool isValid = true;
if (tbMeaDryTBefore.Text == null || tbMeaDryTBefore.Text == ""
|| tbMeaWetTBefore.Text == null || tbMeaWetTBefore.Text == ""
|| tbMeaPressBefore.Text == null || tbMeaPressBefore.Text == "") {
isValid = false;
lbMsg.Visibility = Visibility.Visible;
lbMsg.Content = "数据未输入完全!";
}
else {
try {
Convert.ToDouble(tbMeaDryTBefore.Text);
Convert.ToDouble(tbMeaWetTBefore.Text);
Convert.ToDouble(tbMeaPressBefore.Text);
lbMsg.Visibility = Visibility.Hidden;
}
catch {
isValid = false;
lbMsg.Visibility = Visibility.Visible;
lbMsg.Content = "请输入正确的数字!";
}
}
if (!isValid) {
btNext.IsEnabled = false;
}
else {
btNext.IsEnabled = true;
}
}
示例2: Textbox_TextChanged
private void Textbox_TextChanged(object sender, TextChangedEventArgs e)
{
_currentDeck.Note = Textbox.Text;
_currentDeck.Edited();
_noteChanged = true;
BtnSave.IsEnabled = true;
}
示例3: txtSearch_TextChanged
private void txtSearch_TextChanged(object sender, TextChangedEventArgs e)
{
if (txtSearch.Text != "")
{
int id = Int32.Parse(txtSearch.Text);
Student student = rep.getStudent(id);
txtName.Text = student.StudentName;
if (student.StudentAddress != null)
{
txtDireccion1.Text = student.StudentAddress.Address1;
txtDireccion2.Text = student.StudentAddress.Address2;
txtCiudad.Text = student.StudentAddress.City;
}
else
{
txtDireccion1.Text = "";
txtDireccion2.Text = "";
txtCiudad.Text = "";
}
txtStandardId.Text = student.StudentID.ToString();
dataGrid.ItemsSource = student.Course.ToList();
}
}
示例4: OnTextChanged
/// <summary>
/// TextChanged event handler for secure storing of password into Visual Tree,
/// text is replaced with pwdChar chars, clean text is kept in
/// Text property (CLR property not snoopable without mod)
/// </summary>
protected override void OnTextChanged(TextChangedEventArgs e)
{
if (dirtyBaseText)
return;
string currentText = BaseText;
int selStart = SelectionStart;
if (password != null && currentText.Length < password.Length)
{
// Remove deleted chars
password = password.Remove(selStart, password.Length - currentText.Length);
}
if (!string.IsNullOrEmpty(currentText))
{
for (int i = 0; i < currentText.Length; i++)
{
if (currentText[i] != pwdChar)
{
Debug.Assert(password != null, "Password can't be null here");
// Replace or insert char
string currentCharacter = currentText[i].ToString(CultureInfo.InvariantCulture);
password = BaseText.Length == password.Length ? password.Remove(i, 1).Insert(i, currentCharacter) : password.Insert(i, currentCharacter);
}
}
Debug.Assert(password != null, "Password can't be null here");
BaseText = new string(pwdChar, password.Length);
SelectionStart = selStart;
}
base.OnTextChanged(e);
}
示例5: tbIPAddress_TextChanged
private void tbIPAddress_TextChanged(object sender, TextChangedEventArgs e)
{
if (checkValidIPAddress(tbIPAddress.Text))
{
btnOkay.IsEnabled = true;
}
}
示例6: textBoxSideB_TextChanged
private void textBoxSideB_TextChanged(object sender, TextChangedEventArgs e)
{
long content;
try
{
content = Convert.ToInt64(textBoxSideB.Text);
if (content > 0)
{
b = content;
if (a != null && c != null)
{
Calculate();
}
else
{
labelResult.Content = string.Empty;
}
}
else
{
b = null;
labelResult.Content = "The sides must be positive!";
image.Source = null;
}
}
catch (FormatException)
{
b = null;
labelResult.Content = "The sides must be a positive integer";
image.Source = null;
}
}
示例7: TextBoxLink_TextChanged
private void TextBoxLink_TextChanged(object sender, TextChangedEventArgs e)
{
if (!radioCustomURL.IsChecked.HasValue || !radioSteamID.IsChecked.HasValue) //IsChecked is a Nullable<bool>. We can't continue if either are null.
{
return;
}
//TODO: CHANGE THIS METHOD
if((bool)radioCustomURL.IsChecked)
{
if(tbLink.Text.Length < "steamcommunity.com/id/".Length)
{
tbLink.Text = "steamcommunity.com/id/";
tbLink.SelectionStart = tbLink.Text.Length + 1;
}
}
else if((bool)radioSteamID.IsChecked)
{
if(tbLink.Text.Length < "steamcommunity.com/profiles/".Length)
{
tbLink.Text = "steamcommunity.com/profiles/";
tbLink.SelectionStart = tbLink.Text.Length + 1;
}
}
}
示例8: txtName_TextChanged
private void txtName_TextChanged(object sender, TextChangedEventArgs e)
{
if (txtName.Text != "")
btnSave.IsEnabled = true;
else
btnSave.IsEnabled = false;
}
示例9: searchTextBox_TextChanged
private void searchTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (searchTextBox.Text == "")
{
AppComponent.StopThreads();
ImageBrush textImageBrush = new ImageBrush();
try
{
textImageBrush.ImageSource =
new BitmapImage(
new Uri("res/searchBackground.png", UriKind.Relative)
);
}
catch { }
textImageBrush.AlignmentX = AlignmentX.Left;
textImageBrush.Stretch = Stretch.None;
searchTextBox.Background = textImageBrush;
PublishWords(FileData.FileContents);
}
else
{
SolidColorBrush b = new SolidColorBrush();
b.Color = Color.FromRgb(255, 255, 255);
searchTextBox.Background = b;
RunSearch(searchTextBox.Text);
}
}
示例10: realTimeInput_TextChanged
private void realTimeInput_TextChanged(object sender, TextChangedEventArgs e)
{
var inputBox = sender as TextBox;
if (inputBox != null)
{ RealTimeUpdate = inputBox.Text; }
}
示例11: txtBarcodeImageFile_TextChanged
private void txtBarcodeImageFile_TextChanged(object sender, TextChangedEventArgs e)
{
if (File.Exists(txtBarcodeImageFile.Text))
{
imageBarcode.Source = new BitmapImage(new Uri(txtBarcodeImageFile.Text));
}
}
示例12: search_TextChanged
private void search_TextChanged(object sender, TextChangedEventArgs e)
{
//damit search auf "" gesetzt werden kann
if (skipTextChange)
{
return;
}
else
{
clearTextBoxes();
string text = search.Text;
List<string> autoList = new List<string>();
//case no sensitive --> ToUpper, 1 ... vorname,leer taste , 2 ... nachname
List<Kunde> kunden = hm.repKunde.Get().Where(k => (k.vornameKunde + " " + k.nachnameKunde).ToUpper().StartsWith(text.ToUpper())).ToList();
if (kunden.Count() > 0)
{
lbSuggestion.ItemsSource = kunden;
lbSuggestion.Visibility = Visibility.Visible;
}
else
{
lbSuggestion.Visibility = Visibility.Hidden;
lbSuggestion.ItemsSource = null;
}
//wenn textbox leer ist
if (string.IsNullOrEmpty(search.Text))
{
lbSuggestion.Visibility = Visibility.Hidden;
lbSuggestion.ItemsSource = null;
}
}
}
示例13: firstTb_TextChanged
private void firstTb_TextChanged(object sender, TextChangedEventArgs e)
{
tbValue2.Text = tbValue1.Text;
tbValue3.Text = tbValue1.Text;
tbValue4.Text = tbValue1.Text;
checkValid();
}
示例14: TextBox_TextChanged
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
double temp;
if (Button_OK != null && VoltageValue != null) {
Button_OK.IsEnabled = double.TryParse(VoltageValue.Text, out temp);
}
}
示例15: textBox1_TextChanged
private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
foreach (TextChange tc in e.Changes)
{
if (tc.AddedLength > 0)
{
if (_iowBS.typedChars.Length <= _iowBS.numberOfTypedChars) return;
textBox1.BorderBrush = Brushes.Black;
for (int i = 0; i < tc.AddedLength; i++)
{
char c = textBox1.Text[tc.Offset + i];
if (c == '\\') inHex = true;
else if (inHex)
{
if (charCount == 0)
lastChar[charCount++] = c;
else
{
lastChar[1] = c;
string s = new string(lastChar);
_iowBS.inByte = Convert.ToByte(s, 16);
inHex = false;
charCount = 0;
}
}
else
{
_iowBS.inByte = (byte)c;
}
}
}
}
}