• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TextChangedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TextChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# TextChangedEventArgs类的具体用法?C# TextChangedEventArgs怎么用?C# TextChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextChangedEventArgs类属于命名空间,在下文中一共展示了TextChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FindBoxTextChanged

        private void FindBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            string textToFind = findBox.Text;

            if (textToFind != null)
                FindAndHighlightText(textToFind);
        }
开发者ID:mbin,项目名称:Win81App,代码行数:7,代码来源:Scenario6.xaml.cs


示例2: fctb_TextChanged

 private void fctb_TextChanged(object sender, TextChangedEventArgs e)
 {
     //clear folding markers
     e.ChangedRange.ClearFoldingMarkers();
     //set markers for folding
     e.ChangedRange.SetFoldingMarkers("{", "}");
 }
开发者ID:Celtech,项目名称:BolDevStudio,代码行数:7,代码来源:SimplestCodeFoldingSample.cs


示例3: DesiredAccuracyInMeters_TextChanged

        void DesiredAccuracyInMeters_TextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                uint value = uint.Parse(DesiredAccuracyInMeters.Text);

                SetDesiredAccuracyInMeters.IsEnabled = true;

                // clear out status message
                rootPage.NotifyUser("", NotifyType.StatusMessage);
            }
            catch (ArgumentNullException)
            {
                SetDesiredAccuracyInMeters.IsEnabled = false;
            }
            catch (FormatException)
            {
                rootPage.NotifyUser("Desired Accuracy must be a number", NotifyType.StatusMessage);
                SetDesiredAccuracyInMeters.IsEnabled = false;
            }
            catch (OverflowException)
            {
                rootPage.NotifyUser("Desired Accuracy is out of bounds", NotifyType.StatusMessage);
                SetDesiredAccuracyInMeters.IsEnabled = false;
            }
        }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:26,代码来源:Scenario2_GetPosition.xaml.cs


示例4: markkaTextBox_TextChanged

 private void markkaTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (changing)
     {
         if (markkaTextBox.Text.Length > 0)
         {
             result = Double.TryParse(markkaTextBox.Text, out markkaToEuro);
             if (result)
             {
                 markkaToEuro = Convert.ToDouble(markkaTextBox.Text);
                 markkaToEuro = markkaToEuro / 5.94573;
             }
             else
             {
                 markkaToEuro = 0;
             }
         }
         else
         {
             markkaToEuro = 0;
         }
         euroTextBox.Text = markkaToEuro.ToString("0.00");
         changing = false;
     }
 }
开发者ID:H8872,项目名称:Demo9,代码行数:25,代码来源:MainPage.xaml.cs


示例5: CSharpSyntaxHighlight

        private void CSharpSyntaxHighlight(TextChangedEventArgs e)
        {
            fctb.LeftBracket = '(';
            fctb.RightBracket = ')';
            fctb.LeftBracket2 = '\x0';
            fctb.RightBracket2 = '\x0';
            //clear style of changed range
            e.ChangedRange.ClearStyle(BlueStyle, BoldStyle, GrayStyle, MagentaStyle, GreenStyle, BrownStyle);

            //string highlighting
            e.ChangedRange.SetStyle(BrownStyle, @"""""|@""""|''|@"".*?""|(?<[email protected])(?<range>"".*?[^\\]"")|'.*?[^\\]'");
            //comment highlighting
            e.ChangedRange.SetStyle(GreenStyle, @"//.*$", RegexOptions.Multiline);
            e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(/\*.*)", RegexOptions.Singleline);
            e.ChangedRange.SetStyle(GreenStyle, @"(/\*.*?\*/)|(.*\*/)", RegexOptions.Singleline|RegexOptions.RightToLeft);
            //number highlighting
            e.ChangedRange.SetStyle(MagentaStyle, @"\b\d+[\.]?\d*([eE]\-?\d+)?[lLdDfF]?\b|\b0x[a-fA-F\d]+\b");
            //attribute highlighting
            e.ChangedRange.SetStyle(GrayStyle, @"^\s*(?<range>\[.+?\])\s*$", RegexOptions.Multiline);
            //class name highlighting
            e.ChangedRange.SetStyle(BoldStyle, @"\b(class|struct|enum|interface)\s+(?<range>\w+?)\b");
            //keyword highlighting
            e.ChangedRange.SetStyle(BlueStyle, @"\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b|#region\b|#endregion\b");

            //clear folding markers
            e.ChangedRange.ClearFoldingMarkers();

            //set folding markers
            e.ChangedRange.SetFoldingMarkers("{", "}");//allow to collapse brackets block
            e.ChangedRange.SetFoldingMarkers(@"#region\b", @"#endregion\b");//allow to collapse #region blocks
            e.ChangedRange.SetFoldingMarkers(@"/\*", @"\*/");//allow to collapse comment block
        }
开发者ID:remco138,项目名称:FastColoredTextBox,代码行数:32,代码来源:PowerfulSample.cs


示例6: PPLSyntaxHighlight

 private void PPLSyntaxHighlight(TextChangedEventArgs e)
 {
     e.ChangedRange.SetStyle(_blueStyle,
         //available actions
         @"\b(when|and|or)\b",
         RegexOptions.IgnoreCase | RegexCompiledOption);
 }
开发者ID:aprishchepov,项目名称:roslyn-shopping-cart-dsl,代码行数:7,代码来源:Editor.cs


示例7: SearchBar_OnTextChanged

		/// <summary>
		/// This is a temp implementation, make a server call when fully implemented
		/// Source From https://blog.verslu.is/xamarin/finding-nemo-implementing-xamarin-forms-searchbar/
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">E.</param>
		private async void SearchBar_OnTextChanged (object sender, TextChangedEventArgs e)
		{
			//todo : implement using server call
			var people = peopleListview.ItemsSource as ObservableCollection<Person>;

			if (people != null) {
				if (_originalSource == null)
					_originalSource = people;
				
				peopleListview.IsRefreshing = true;

				//Simulate long server call
				await Task.Delay (TimeSpan.FromSeconds (2)).ContinueWith ((r) => {

//					Device.BeginInvokeOnMainThread (() =>
//						{
//							if (string.IsNullOrWhiteSpace(e.NewTextValue))
//								peopleListview.ItemsSource = _originalSource;
//							else
//								peopleListview.ItemsSource = new ObservableCollection<Person>(_originalSource.Where(p => p.FullName.ToLower ().Contains(e.NewTextValue.ToLower ()) 
//									|| p.PhoneNumber.Contains (e.NewTextValue)));
//
//							peopleListview.IsRefreshing = false;
//						});
				});
			
			}
		}
开发者ID:paulpatarinski,项目名称:ModernDirectory,代码行数:34,代码来源:DirectoryPage.xaml.cs


示例8: host_TextChanged

 private void host_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (settings.ContainsKey("Host"))
         settings["Host"] = host.Text;
     else
         settings.Add("Host", host.Text);
 }
开发者ID:undwad,项目名称:2Desktop,代码行数:7,代码来源:MainPage.xaml.cs


示例9: port_TextChanged

 private void port_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (settings.ContainsKey("Port"))
         settings["Port"] = port.Text;
     else
         settings.Add("Port", port.Text);
 }
开发者ID:undwad,项目名称:2Desktop,代码行数:7,代码来源:MainPage.xaml.cs


示例10: ApplicantSearchTextBox_TextChanged

        private void ApplicantSearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            filteredApplicants = new List<Person>();

            var senderTextBox = (TextBox)sender;

            if (senderTextBox.Text.Equals(""))
            {
                ApplicantsListView.ItemsSource = applicants;
            }

            foreach (var applicant in applicants)
            {
                if (applicant.FirstName.ToLower().Contains(senderTextBox.Text.ToLower())){
                    filteredApplicants.Add(applicant);
                    continue;
                }

                if (applicant.LastName.ToLower().Contains(senderTextBox.Text.ToLower())){
                    filteredApplicants.Add(applicant);
                    continue;
                }

                var fullName = applicant.FirstName + " " + applicant.LastName;
                if (fullName.ToLower().Contains(senderTextBox.Text.ToLower())){
                    filteredApplicants.Add(applicant);
                    continue;
                }
            }

            ApplicantsListView.ItemsSource = filteredApplicants;
        }
开发者ID:Tablecreek,项目名称:bid4IT,代码行数:32,代码来源:ApplicantsPage.xaml.cs


示例11: ReplaceSeparatorChar

        private async void ReplaceSeparatorChar(object sender, TextChangedEventArgs e)
        {
            double amount;
            if (double.TryParse(TextBoxAmount.Text, out amount))
            {
                // todo: this try should be removeable, will see after the next version.
                try
                {
                    //cursorpositon to set the position back after the formating
                    var cursorposition = TextBoxAmount.SelectionStart;

                    var formattedText =
                        Utilities.FormatLargeNumbers(amount);

                    cursorposition = AdjustCursorPosition(formattedText, cursorposition);

                    TextBoxAmount.Text = formattedText;

                    //set the cursor back to the last positon to avoid jumping around
                    TextBoxAmount.Select(cursorposition, 0);
                }
                catch (FormatException ex)
                {
                    Insights.Report(new ExtendedFormatException(ex, TextBoxAmount.Text));
                }
            }
            else if (string.Equals(TextBoxAmount.Text, Strings.HelloWorldText, StringComparison.CurrentCultureIgnoreCase)
                     ||
                     string.Equals(TextBoxAmount.Text, Strings.HalloWeltText, StringComparison.CurrentCultureIgnoreCase))
            {
                await new MessageDialog(Strings.HelloWorldResponse).ShowAsync();
            }
        }
开发者ID:jgodinez,项目名称:MoneyManager,代码行数:33,代码来源:ModifyTransactionView.xaml.cs


示例12: examWeightTextBox_TextChanged

 private void examWeightTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (examWeightTextBox.Text != "")
     {
         ((App)Application.Current).grades.examWeight = (Double.Parse(examWeightTextBox.Text)) / 100;
     }
 }
开发者ID:rolpe,项目名称:GoalGrade,代码行数:7,代码来源:ExamWeight.xaml.cs


示例13: ValidatePhoneNumber

		public static void ValidatePhoneNumber(object sender, TextChangedEventArgs e){
			Entry phoneNumber = sender as Entry;
			if (phoneNumber.Text == string.Empty)
				return;

			var numbers = Regex.Replace(phoneNumber.Text, @"\D", "");
			if (numbers.Length <= 3)
			{
				phoneNumber.Text = numbers;
				return;
			}


			if (numbers.Length <= 7){
				phoneNumber.Text = string.Format("{0}-{1}", numbers.Substring(0, 3), numbers.Substring(3));
				return;
			}

			phoneNumber.Text = String.Format(
				"({0}) {1}-{2}", 
				numbers.Substring(0, 3), 
				numbers.Substring(3, 3), 
				numbers.Substring(6)
			);
		}
开发者ID:MobileFit,项目名称:CoachV2,代码行数:25,代码来源:Utility.cs


示例14: ColoredTextBox_TextChanged

 void ColoredTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (this.Text.Length == 0)
         this.Background = new SolidColorBrush(Colors.Pink);
     else
         this.Background = new SolidColorBrush(Colors.White);
 }
开发者ID:noriike,项目名称:xaml-106136,代码行数:7,代码来源:ColoredTextBox.cs


示例15: fctb_TextChanged

 private void fctb_TextChanged(object sender, TextChangedEventArgs e)
 {
     //clear old styles of chars
     e.ChangedRange.ClearStyle(ellipseStyle);
     //append style for word 'Babylon'
     e.ChangedRange.SetStyle(ellipseStyle, @"\bBabylon\b", RegexOptions.IgnoreCase);
 }
开发者ID:Demirbilekmt,项目名称:FastColored-TextBox-Unicode,代码行数:7,代码来源:CustomStyleSample.cs


示例16: fctb_TextChangedDelayed

        private void fctb_TextChangedDelayed(object sender, TextChangedEventArgs e)
        {
            //delete all markers
            fctb.Range.ClearFoldingMarkers();

            var currentIndent = 0;
            var lastNonEmptyLine = 0;

            for (int i = 0; i < fctb.LinesCount; i++)
            {
                var line = fctb[i];
                var spacesCount = line.StartSpacesCount;
                if (spacesCount == line.Count) //empty line
                    continue;

                if (currentIndent < spacesCount)
                    //append start folding marker
                    fctb[lastNonEmptyLine].FoldingStartMarker = "m" + currentIndent;
                else
                if (currentIndent > spacesCount)
                    //append end folding marker
                    fctb[lastNonEmptyLine].FoldingEndMarker = "m" + spacesCount;

                currentIndent = spacesCount;
                lastNonEmptyLine = i;
            }
        }
开发者ID:Celtech,项目名称:BolDevStudio,代码行数:27,代码来源:CustomFoldingSample.cs


示例17: playerName_TextChanged

        private async void playerName_TextChanged(object sender, TextChangedEventArgs e)
        {
            // ";[]{}" are forbidden in name because of json format, clear the latest character if it is any of those
            if (playerName.Text.Contains(";") || playerName.Text.Contains("[") || playerName.Text.Contains("]") || 
                playerName.Text.Contains("{") || playerName.Text.Contains("}"))
            {
                playerName.Text = playerName.Text.Remove(playerName.Text.Length - 1);
            }

            // when player name field is cleared, disable button and do nothing else
            if (playerName.Text.Length == 0)
            {
                IsPrimaryButtonEnabled = false;
                infoText.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                return;
            }
            
            // try to get existing player from database
            var player = await SampleDataSource.GetPlayerAsync(playerName.Text); 

            // if there is existing player with the name, disable button and show info text
            if (player != null)
            {
                IsPrimaryButtonEnabled = false;
                infoText.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            // no players found from database, free to create one
            else
            {
                IsPrimaryButtonEnabled = true;
                infoText.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
        }
开发者ID:markus-j,项目名称:puttgamesUWP,代码行数:33,代码来源:AddPlayerDialog.xaml.cs


示例18: fctb_TextChanged

 private void fctb_TextChanged(object sender, TextChangedEventArgs e)
 {
     //clear previous highlighting
     e.ChangedRange.ClearStyle(brownStyle);
     //highlight tags
     e.ChangedRange.SetStyle(brownStyle, "<[^>]+>");
 }
开发者ID:Celtech,项目名称:BolDevStudio,代码行数:7,代码来源:SimplestSyntaxHighlightingSample.cs


示例19: BingKeyTextBox_TextChanged

 private void BingKeyTextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if ((sender as TextBox).Text.Length >= 64)
         LoadMapButton.IsEnabled = true;
     else
         LoadMapButton.IsEnabled = false;
 }
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:BingLayerSample.xaml.cs


示例20: searchPatients

        // Doctor has started typing a patient's name in.. try to match the name
        // and output possible patients for him/her to select
        private void searchPatients(object sender, TextChangedEventArgs e)
        {
            if (search.Text == "Search for a Patient")
            {
                search.Text = "";
                return;
            }

            // Remove all ids from the listbox
            while(MedicalID.Items.Count > 0)
            {
                MedicalID.Items.RemoveAt(MedicalID.Items.Count-1);
            }

            // Populate listbox with Possible suggestions
            string query = search.Text;
            for (uint i = 0; i < patients.Count; i++)
            {
                var name = patients.GetObjectAt(i).GetNamedString("Name");
                var doctor = patients.GetObjectAt(i).GetNamedString("Doctor");
                if (doctor == docName)
                {
                    if(name.StartsWith(query))
                        MedicalID.Items.Add(name);
                }
            }
        }
开发者ID:ndm4766,项目名称:SmartStroke,代码行数:29,代码来源:PatientSelection.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextComment类代码示例发布时间:2022-05-24
下一篇:
C# TextChange类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap