当前位置: 首页>>代码示例>>C#>>正文


C# Controls.TextChangedEventArgs类代码示例

本文整理汇总了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;
     }
 }
开发者ID:whw123,项目名称:measureSideApp,代码行数:30,代码来源:Step15.xaml.cs

示例2: Textbox_TextChanged

		private void Textbox_TextChanged(object sender, TextChangedEventArgs e)
		{
			_currentDeck.Note = Textbox.Text;
			_currentDeck.Edited();
			_noteChanged = true;
			BtnSave.IsEnabled = true;
		}
开发者ID:modulexcite,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:DeckNotes.xaml.cs

示例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();
            }

        }
开发者ID:Maldercito,项目名称:adat,代码行数:26,代码来源:1453203751$MainWindow.xaml.cs

示例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);
        }
开发者ID:chris134pravin,项目名称:VisualStudio,代码行数:36,代码来源:SecurePasswordBox.cs

示例5: tbIPAddress_TextChanged

 private void tbIPAddress_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (checkValidIPAddress(tbIPAddress.Text))
     {
         btnOkay.IsEnabled = true;
     }
 }
开发者ID:bdr27,项目名称:c-,代码行数:7,代码来源:IPAddressModal.xaml.cs

示例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;
            }
        }
开发者ID:jacobege,项目名称:2nd_semester_test_exercise_0,代码行数:33,代码来源:MainWindow.xaml.cs

示例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;
                }
            }
        }
开发者ID:aramlaka,项目名称:ArbitrarySteam,代码行数:26,代码来源:MainWindow.xaml.cs

示例8: txtName_TextChanged

 private void txtName_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (txtName.Text != "")
     btnSave.IsEnabled = true;
       else
     btnSave.IsEnabled = false;
 }
开发者ID:msachs,项目名称:TestRepo2,代码行数:7,代码来源:ChangeSoundName.xaml.cs

示例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);
     }
 }
开发者ID:grigory-51,项目名称:gap-c-sharp-homework,代码行数:27,代码来源:file.xaml.cs

示例10: realTimeInput_TextChanged

        private void realTimeInput_TextChanged(object sender, TextChangedEventArgs e)
        {
            var inputBox = sender as TextBox;

            if (inputBox != null)
            { RealTimeUpdate = inputBox.Text; }
        }
开发者ID:adamkrieger,项目名称:ProgDataBinding,代码行数:7,代码来源:OneWaySourceToTarget.cs

示例11: txtBarcodeImageFile_TextChanged

 private void txtBarcodeImageFile_TextChanged(object sender, TextChangedEventArgs e)
 {
    if (File.Exists(txtBarcodeImageFile.Text))
    {
       imageBarcode.Source = new BitmapImage(new Uri(txtBarcodeImageFile.Text));
    }
 }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:7,代码来源:MainWindow.xaml.cs

示例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;
                }
            }
        }
开发者ID:hrmKoal,项目名称:HRMdiplArbeit_Pilz,代码行数:34,代码来源:CustomPage.xaml.cs

示例13: firstTb_TextChanged

 private void firstTb_TextChanged(object sender, TextChangedEventArgs e)
 {
     tbValue2.Text = tbValue1.Text;
     tbValue3.Text = tbValue1.Text;
     tbValue4.Text = tbValue1.Text;
     checkValid();
 }
开发者ID:whw123,项目名称:measureSideApp,代码行数:7,代码来源:Step20.xaml.cs

示例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);
     }
 }
开发者ID:kodack64,项目名称:NIDAQ_Control,代码行数:7,代码来源:EditValueWindow.xaml.cs

示例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;
                 }
             }
         }
     }
 }
开发者ID:DOPS-CCI,项目名称:CCI_project,代码行数:33,代码来源:IOWindow.xaml.cs


注:本文中的System.Windows.Controls.TextChangedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。