WPF的TextBox中的自动完成

编程入门 行业动态 更新时间:2024-10-26 04:25:05
本文介绍了WPF的TextBox中的自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在TextBox(System.Windows.Controls)控件中使用AutoComplete属性,就像TextBox(System.Windows.Forms)在C#中控制Windows应用程序一样?

解决方案

问题重新发布。 我已经为您的问题提供了解决方案。 -KR

您好, 查看这些CodeProject文章: 可重用的WPF自动完成文本框 [ ^ ] 可重复使用的WPF自动完成文本框(第2部分) [ ^ ] WPF中的AutoSuggest和AutoComplete控件 [ ^ ] WPF自动填充文本框控件 [ ^ ] WPF自动完成控制 [ ^ ]

尝试这种类型的

< ! - AutoCompleteTextbox.xaml文件 - > < canvas x: class = WPFAutoCompleteTextbox.AutoCompleteTextBox xmlns:x = #unknown > xmlns = schemas.microsoft / winfx / 2006 / xaml / presentation xmlns:x = http:// schemas.microsoft/winfx/2006/xaml高度= 300宽度= 300 > < / canvas > <! - Window1.xaml file - > < window x: class = WPFAutoCompleteTextbox.Window1 xmlns:x = #unknown > xmlns = schemas.microsoft / winfx / 2006 / xaml / presentation xmlns:x = http:// schemas.microsoft/winfx/2006/xaml xmlns:local = clr -namespace:WPFAutoCompleteTextbox Title = WPF AutoCompleteTextBox高度= 200宽度= 300 > < stackpanel background = SteelBlue > < button name = button1 height = 23 width = 75 margin = 20 click = button1_Click horizo​​ntalalignment = 左>清除< / 按钮 > < local:autocompletetextbox height = 23 width = 240 x:name = textBox1 delaytime = 500 threshold = 2 xmlns:local = #unknown /> < / stackpanel > < / window >

或者可以点击此链接获取更多信息和完整信息,试试这个。 code.msdn.microsoft/windowsdesktop/WPF-Autocomplete-Textbox-df2f1791

How to use AutoComplete property in TextBox (System.Windows.Controls) control as like TextBox (System.Windows.Forms) Control of Windows application in C# ?

解决方案

The question is re-posted. I have already provided the solution to your question. -KR

Hi, Have a look at these CodeProject articles: A Reusable WPF Autocomplete TextBox[^] A Reusable WPF Autocomplete TextBox (Part 2)[^] AutoSuggest and AutoComplete control in WPF[^] WPF Autocomplete Textbox Control[^] WPF Auto-complete Control[^]

try this type of

<!--AutoCompleteTextbox.xaml file --> <canvas x:class="WPFAutoCompleteTextbox.AutoCompleteTextBox" xmlns:x="#unknown"> xmlns="schemas.microsoft/winfx/2006/xaml/presentation" xmlns:x="schemas.microsoft/winfx/2006/xaml" Height="300" Width="300"> </canvas> <!-- Window1.xaml file --> <window x:class="WPFAutoCompleteTextbox.Window1" xmlns:x="#unknown"> xmlns="schemas.microsoft/winfx/2006/xaml/presentation" xmlns:x="schemas.microsoft/winfx/2006/xaml" xmlns:local="clr-namespace:WPFAutoCompleteTextbox" Title="WPF AutoCompleteTextBox" Height="200" Width="300"> <stackpanel background="SteelBlue"> <button name="button1" height="23" width="75" margin="20" click="button1_Click" horizontalalignment="Left">Clear</button> <local:autocompletetextbox height="23" width="240" x:name="textBox1" delaytime="500" threshold="2" xmlns:local="#unknown" /> </stackpanel> </window>

or can hit this link for more information and a complete information just try this. code.msdn.microsoft/windowsdesktop/WPF-Autocomplete-Textbox-df2f1791

更多推荐

WPF的TextBox中的自动完成

本文发布于:2023-11-12 05:04:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580585.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动完成   WPF   TextBox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!