WPF的TextBox中的自动完成 [英] AutoComplete in TextBox of WPF
本文介绍了WPF的TextBox中的自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在TextBox(System.Windows.Controls)控件中使用AutoComplete属性,就像TextBox(System.Windows.Forms)在C#中控制Windows应用程序一样?
解决方案
< blockquote>问题重新发布。
我已经为您的问题提供了解决方案。
-KR
您好,
查看这些CodeProject文章:
可重用的WPF自动完成文本框 [ ^ ]
可重复使用的WPF自动完成文本框(第2部分) [ ^ ]
WPF中的AutoSuggest和AutoComplete控件 [ ^ ]
WPF自动填充文本框控件 [ ^ ]
WPF自动完成控制 [ ^ ]
尝试这种类型的< ! - AutoCompleteTextbox.xaml文件 - >
< canvas x: class = WPFAutoCompleteTextbox.AutoCompleteTextBox xmlns:x = #unknown >
xmlns = http://schemas.microsoft.com / winfx / 2006 / xaml / presentation
xmlns:x = http:// schemas.microsoft.com/winfx/2006/xaml高度= 300宽度= 300 >
< / canvas >
<! - Window1.xaml file - >
< window x: class = WPFAutoCompleteTextbox.Window1 xmlns:x = #unknown >
xmlns = http://schemas.microsoft.com / winfx / 2006 / xaml / presentation
xmlns:x = http:// schemas.microsoft.com/winfx/2006/xaml
xmlns:local = clr -namespace:WPFAutoCompleteTextbox
Title = WPF AutoCompleteTextBox高度= < span class =code-string> 200宽度= 300 >
< stackpanel background = SteelBlue >
< button name = button1 height = 23 width = 75 margin = 20 click = button1_Click horizontalalignment = 左>清除< / 按钮 >
< local:autocompletetextbox height = 23 width = 240 x:name = textBox1 delaytime = 500 threshold = 2 xmlns:local = #unknown />
< / stackpanel >
< / window >
或者可以点击此链接获取更多信息和完整信息,试试这个。
http://code.msdn.microsoft.com/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="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> </canvas> <!-- Window1.xaml file --> <window x:class="WPFAutoCompleteTextbox.Window1" xmlns:x="#unknown"> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/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.
http://code.msdn.microsoft.com/windowsdesktop/WPF-Autocomplete-Textbox-df2f1791
这篇关于WPF的TextBox中的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文