<address id="xpjh9"><listing id="xpjh9"><meter id="xpjh9"></meter></listing></address>

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
<noframes id="xpjh9">
<noframes id="xpjh9">

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
    <form id="xpjh9"></form><address id="xpjh9"><listing id="xpjh9"><menuitem id="xpjh9"></menuitem></listing></address>

      <noframes id="xpjh9">
      VB.net 2010 視頻教程 VB.net 2010 視頻教程 VB.net 2010 視頻教程
      SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
      當前位置:
      首頁 > 編程開發 > VBnet >
      • vb.net教程之VB.NET中TextBox的智能感知應用實例

      • 2018-06-10 19:56 來源:未知

      本文實例形式介紹了VB.NET中TextBox的智能感知實現方法,功能非常實用,具體如下:

      該實例主要實現:在TextBox中鍵入字符,可以智能感知出列表,同時對不存在的單詞(沒有出現智能感知的)自動顯示“Not Found”。

      對此功能首先想到的是利用TextBox的AutoComplete功能。該功能允許你設置不同形式的AutoComplete智能感知,譬如:

      1)AutoCompleteSource:設置感知源頭類型(這里是CustomSource)。

      2)AutoCompleteMode:設置感知的模式(輸入不存在的字符追加,不追加還是同時存在,這里顯然不追加)。

      3)AutoCompleteCustomSource:設置源頭數據(AutoCompleteSource必須是CustomSource)。

      接下來思考如何在輸入第一個字符的時候判斷是否被感知到,如果沒有則顯示文本。

      拖拽一個Label到窗體上,然后在TextBox的KeyUp事件中對數據源進行判斷(為了方便,直接先把數據源數據轉化成Array的形式然后使用擴展方法Any進行判斷),同時為了防止界面卡死,使用異步。

      具體實現代碼如下:

      ?
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      Public Class Form1
        Dim collection As New AutoCompleteStringCollection
        Private ReadOnly arrayCollection() As String = {"a"}
       
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       
        End Sub
       
        Public Sub New()
       
          InitializeComponent()
          collection.AddRange(New String() {"apple", "aero", "banana"})
          TextBox1.AutoCompleteCustomSource = collection
          ReDim arrayCollection(collection.Count - 1)
          collection.CopyTo(arrayCollection, 0)
        End Sub
        ''' <summary>
        ''' When release the keys, plz start a background thread to handle the problem
        ''' </summary>
        Private Sub TextBox1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyUp
          Dim act As New Action(Sub()
                       'Check whether there are any values inside the collection or not
                       If (TextBox1.Text = "") OrElse (arrayCollection.Any(Function(s)
                                                   Return s.StartsWith(TextBox1.Text)
                                                 End Function)) Then
       
                         Label1.BeginInvoke(New MethodInvoker(Sub()
                                              Label1.Text = String.Empty
                                            End Sub))
                       Else
                         Label1.BeginInvoke(New MethodInvoker(Sub()
                                              Label1.Text = "Not found"
                                            End Sub))
                       End If
       
                     End Sub)
          act.BeginInvoke(Nothing, Nothing)
        End Sub
      End Class

      這里有一些注意點:

      1)異步的異常不會拋出(因為異步的本質是CLR內部的線程),只能調試時候看到。因此編寫異步程序必須萬分小心。

      2)VB.NET定義數組(譬如定義String(5)的數組,其實長度是6(從0~5)包含“5”自身,因此數組復制(Redim重定義大小)的時候必須Count-1,否則重新定義的數組會多出一個來,默認是Nothing,這會導致異步線程出現異常)。

      相關教程
      江苏快3 www.ccc826.com | www.ra82.com | 2324xxx.com | www.11018.cc | www.10ff8.com | 28824t.com | www.5958818.com | www.56733n.com | sbfa66.com | www.5446qq.com | 62222a.com | www.809296.com | www.9999kk.com | 53262.com | www.982jc.com | www.bw123123.com | 3421h.com | www.5086t.com | www.xpj2108.com | vv879202.com | www.hf0886.com | www.789030.com | 7555l.com | www.qilc3.com | www.hg2258.com | 0693j.com | www.1111y.cc | www.888.ps | zhe988.com | www.503501.com | www.kmk.com | 22kk8331.com | 8520n.com | www.06386633.com | www.0099buyu.com | 2359911.com | www.66870.cc | www.20199kk.com | 3522f.vip | www.476669.com | www.y69096.com | 50024488.com | 2548546.com | www.33598k.com | www.026555.com | 3435n.com | www.570831.com | www.8313b.com | 86068ff.com | 1590.com | www.93gj03.com | www.sun000.com | p88818.com | www.108.gg | www.222bet365.cc | 9030m.com | 2222138.com | www.83033n.com | www.99950020.com | jj7742.com | www.088185.com | www.506902.com | www.1019996.com | 22299oo.com | www.c1350.com | www.99113b.com | jjs1111.com | 8988bb.com | www.7782f.com | www.kzcs4.com | dazhuangjia.me | 234916.com | www.07163x.com | www.998855g.com | 2643h.com | xpj9411.cn | www.4388.cc | www.caipioa33.com | w0595.com | b05677.com | www.701361.com | www.4521a.com | www.127788.net | bet577s.com | www.348677.com | www.7737ee.com | www.144.com.tw | a58955.com | 93936d.com | www.50051l.com | www.85857i.com | yy38648.cc | j2554.com | www.404677.com | www.441394.com | www.kk7788.com | 8036f.com | 4508ww.com | www.715613.com | www.8c999.com | www.h7733.com | 5597lkt.com | 0234f.com | www.607219.com | www.zzyl62.com | www.hg8201.com | 7736k.com | 188qq555.com | 3225g.com | www.ck9292.com | www.509236.com | www.k1128.com | 4195k.com | 22933.com | df6258.com | www.73166.com | www.bet63n.com | www.975426.com | i2894.com | 5478d.com | gh7106.com | www.7793aa.com | www.8j3.com | www.js505.com | 66577.cc | HGW3300.com | 7003dd.com | www.71233i.com | www.3416u.com | www.wns123c.com | www.jb33333.com | www.65533vip.com | 3049y.com | 3473f.com | 9649v.com | www.951077.com | www.222067a.com? | www.ee00668.com | www.91gwa.com | www.4972uu.com | x86.com | 3473g.com | 59889.com | www.178357.com | www.c277.com | www.33997l.com | www.86339f.com | www.198004.com | www.q13608.com | www.dfs779.com | 2146b.com | 80878w.com | ppjj02.com | 38668.com | www.569380.com | www.3552c.com | www.9989576.com | www.6668a.vip | www.lu8810.com | www.js6169.com | www.b3657.com | zhcp63.com | ss4255.com | 4323d.com | 01234www.com | 33382ee.com | www.082710.com | www.739915.com | www.2350p.com | www.4323i.com | www.78680b.com | www.00772e.com | www.csh365.com | www.987msc.com | www.j30226.com | www.817558.com | 4116c.com | x33a.vip | 4997d.com | y0000.com | 77606q.com | 4636677.com | 914910.com | 11998332.com | i3405.com | 55899p.com | 6002aa.com | www.128082.com | www.550116.com | www.818646.com | www.zuan222.com | www.97775.cc | www.3890d.com | www.49956b.com | www.99638f.com | www.4833033.com | www.hr1333.com | www.0612g.com | www.60886g.com | www.861002.com | www.c32031.com | www.06820m.com | www.45598x.com | www.4196y.com | www.j7764.com | www.91779j.com | www.2544g3.com | www.6687c.com | www.663558.com | www.yh234h.com | www.yh234d.com | www.9895l.com | www.t3410.com | www.hgbet4.com | www.8905x.com | www.hg9388.com | www.y07b.com | www.66376w.com | www.86889.com | www.55czt.com | www.ck3578.com | www.700231.com | www.530951.com | www.305644.com | www.54400a.com | 3379tt.com | 55977.com | 338050.com | agaa29.com | 61789d.com | 57157d.com | a757044.com | 3245m.com | www.yh77707.com | www.87680i.com | www.836666e.com | www.47343.com | www.11c668.com | www.57800a.com | www.0600e.cc | www.71399b.com | www.3991.cc | www.647377.com | www.038079.com | y6880.com | 1634m.com | 8159ww.cc | 4182006.com | 99993885.com | www.272875.com | www.699603.com | www.hg173d.com | www.490801.com | www.0270u.com | www.hcjt1.com | www.450689.com | 61329922.com | 500000454.com | 3568c.com | 921730.com | www.19888bet.com | www.soxi588.com | www.22vn777.cc | www.pgylc.com | www.44clf.com | www.316546.com | ss3405.com | 81366r.com | 33ii8331.com | www.7025b.com | www.27799a.com | www.631609.com | www.zmfqp.net | www.739908.com | n61653.com | 3467i.com | 3685a.com | www.ts11888.com | www.09766.com | www.45598v.com | www.77016.cc | www.209703.com | bet35365w.com | 36406688.com | www.yddc05.com | www.8806132.com | www.w84e.com | www.5799.cc | 4233.com | 3640a.com | www.jinsha49.com | www.705msc.com | www.36456.com | www.950596.com | 81511n.com | 4488ccc.com | www.666xin2.com | www.3833ww.com | www.bet686.com | www.998349.com | 87680p.com | 35222k.com | www.0636b.com | www.58665r.com | www.js18685.com | www.551416.com | ag80.vip | xpj000555.com | www.dr1199.com | www.4809v.com | www.910155.com | 6137i.net | JS1388s.com | www.yh8402.com | www.40288y.com | www.881803.com | 77605k.com | 56988u.com | www.597449.com | www.43384.com | www.081501.com | qq365p.com | www.zr1166.com | www.00772d.com | www.k795.com | 88850aa.com | 56987dd.com | www.keebin.com | www.84499r.com | 324138.com | 711066.com | www.amdc0066.com | www.pj56j.com | 8827aa.com | 4647r.com | www.538598.com | www.55238f.com | 21vnsvns.com | 0332x.com | www.508345.com | www.51515r.com | feicai0451.com | 8036g.com | www.998855n.com | www.3552c.com | 05075555.com | www.7720z.com | www.331068.com | www.586775.com | 0615.com | www.10601.com | www.36582222.com | 7874.cc | 746263.com | www.0072737.com | www.629293.com | www.msc93.com | 7240t.com | www.76060g.com | www.79095k.com | www.196309.com | wns26.com | www.ty23023.com | www.gai57.com | tzvip2022.com | www.www6161msc.com | www.0087k.com | www.137105.com | hh7742.com | www.tyc606.com | www.ybao3.com | 3304zz.com | www.440887.com | www.85267.com | 50020088.com | www.ylg0099.com | www.590345.com | www.454589.com | 00uu8332.com | www.3846r.com | www.943077.com | 9737xx.me | www.749888.com | www.83560.com | 81005.com | www.692tyc.com | www.4923t.com | 815077.com | www.033033v.com | www.07679p.com | P35oo.com | 9030z.com | www.4996xm.com | www.039079.com | 1077ooo.com | www.7225o.com | www.34788o.com | yhw5.cc | www.dsn96.net | hg8893.com | 56988i.com | www.w84g.com | 59599h.com | www.pj6698.com | www.110272.COM | 77bet.com | www.2090911.com | www.206065.com | 3559p.com | www.84303.com | www.am7588.com | 634.cm | www.8967x.com | www.176223.com | 500000874.com | www.88325e.com | js777js.com | www.8694r.com | www.32123s.com | 66671d.com | www.668cp88.com | www.106280.com | o00351.com | www.6678573.com | bj399.com | www.0022524.com | www.820158.com | o62365.com | www.9464005.com | ah116.net | www.7726e.com | www.rcw8855.com | 2381ggg.com | www.60886s.com | 6396c.com | www.cz3065.com | www.743633.com | feicai0714.com | www.742988.com | afcp04.com | www.2244-0880.com | www.186756.com | www.30088hg.com | www.49956s.com | 99589q.net | www.y6094.com | 8547r.com | www.38789b.com | www.317199.com | www.bmw0005.com | www.34788w.com | 77606w.com | www.109115.com | 67890y.com | www.xj666o.com | 3aobo.com | www.05125f.com | www.799497.com | 023139.com | www.07163c.com | 9971002.com | www.9996yy.com | 93936f.com | www.64566d.com | 38989h.com | www.sscb22.cc | 6033p.com | www.10444.com | c89qe65.com | www.1484vip3.com | 1813p.com | www.6666zs.com | www.230961.com | www.2846t.com | www.497918.com | www.cr689.com | www.606920.com | www.xinhao03.com | www.725422.com | www.63877y.com | www.861944.com | www.wns8828.com | www.907994.com | www.498888k.com | www.985026.com | www.hg45888.com | www.cp718.vip | www.ylg2206.com | www.771645.com | www.0505v.com | www.658960.com | www.hg0051.com | www.534077.com | www.55268yy.com | www.330871.com | www.xin006.com | www.246841.com | www.107898.com | 61327711.com | www.3122v.com | 2776.com | www.7893w33.com | 4775522.com | www.29586.com | 80368zz.com | www.84499g.com | 44zz8331.com | www.936250.com | www.hg8987.com | www.39500a.com | www.67885.com | yataibet5.com | www.5981y.com | bet577z.com | www.07679q.com | ylzz3338.com | www.21202b.com | 69990v.com | www.558414.com | www.99951144.com | JS777.la | www.bwin920.co | 4189222.com | www.5958128.com | js61z.com | www.lycp886.com | www.2078r.com | 38821199.com | www.5981q.com | 51133j.com | www.16878s.com | www.28758s.com | 20679455.com | www.98698t.com | 88119f.com | www.80065d.com | www.4123mm.com | www.196280.com | www.blg888.com | ylzz322.com | www.68993225.com | 4052aa.com | www.312180.com | www.v72888.com | bet577t.com | www.dayou800.com | www.585299.com | 8015p.com | www.184897.com | 3534h.com | www.1555hc.com | www.44744.com | 36401133.com | www.r999997.com | 081753.com | www.299695.com | www.l456x.com | 3845.com | www.ct8822.com | www.hga8383.com | 88682.com | www.71399q.com | www.hg1966.com | 3614o.com | www.55676r.com | www.js60g.com | jmszszx.com | www.88325x.com | 500000874.com | df8t.com | www.sb5503.com | 7989i.com | www.220875.com | www.53097777.com | spj80.net | www.126438.com | www.cn365a.com | 15920000.com | www.560681.com | www.4212t.com | 76886e.com | www.047788.com | www.3983116.com | 081753.com | 168cp-b.com | www.7920r.com | www.k8368.net | 3245x.com | www.535520.com | www.3024.com | 0343o.com | www.269777a.com | www.6001343.com | 2757h.com | www.50080a.com | www.t3410.com | www.156250.com | 0652h.com | www.60007n.com | www.358012.com | 6150i.com | www.795917.com | www.s32939.com | 5589l.com | 20188w.com | www.5265.com | www.37562.com | ddd67890.com | www.401267.com | www.562351.com | www.bb0709.com | 077ll.com | www.833369.com | www.blm5544.com | 4488a.com | www.106260.com | www.511219.com | www.28758q.com | 9566560.com | www.791317.com | www.3116h.com | www.5911o.com | 459.com | www.qmkl2.com | www.ff55826.com | z88rr.com | 66c51.com | www.05028.com | www.79500q.com | yinhewang.cc | 1654dd.com | www.c6449.com | www.50999c.com | www.yz488.com | 8381o.com | www.595707.com | www.a32031.com | www.333222o.com | 66112007.com | www.142525.cc | www.9422h.com | www.554msc.com | 7605x.com | 07377.com | www.26163g.com | www.705905.com | www.9464770.com | 0208bb.com | www.756764.com | www.0600b.cc | www.789270.com | 77605s.com | 6033j.com | www.hy5501.com | www.118.ceo | www.hg0198.com | 192222.com | by301.com | www.gy1.com | www.jz3888.com | www.x5055.com | wnsr828.com | 996622zz.com | www.976917.com | www.16181h.com | www.0860z.com | 50067f.com | 5855pp.com | www.820158.com | www.883399g.com | www.ffvns.com | 2864i.com | 883399s.com | www.53900o.com | www.00840c.com | www.hjdc2008.com | www.hg3569.com | bet28b.com | 287711.com | www.225863.com | www.73166c.com | www.783544.com | www.gf11888.com | jz7jz7.com | pjjiangxi.com | 18775m.com | www.cz5658.com | www.7681004.com | www.120509.com | www.806313.com | 9649c.com | 28758s.com | 866666k.com | www.912483.com | www.55717y.com | www.98698s.com | www.40033.1640033.com | ss56988.com | spj01.net | c83b784w.com | www.598411.com | www.89894q.com | www.b32031.com | www.548058.com | www.y611.com | 8977hh.com | bm1398.com | rrxiu.net | www.843980.com | www.77802p.com | www.4546200.com | www.56655t.com | www.080948.com | amjsc01.com | 4288nn.com | 3936d.com | 3286.com | www.314005.com | www.zfcp3.com | www.6022888.com | www.xj6004.com | www.998855l.com | www.z0151.com | 9195js.com | 51133dd.com | 11018y.com | 1869.com | dzhcp5.com | www.348477.com | www.cai345.cc | www.68689f.com | www.89789v.com | www.7893w36.com | www.9928h.com | www.3657h.com | www.hg288.com | 7744yyy.com | 55545r.com | 7599gg.com | 7508i.com | 00048w.com | 500000858.com | www.32123e.com | www.665993.com | www.9928f.com | www.hg3005.com | www.606668.com | www.9925546.com | www.38987.com | www.v445566.com | www.yh02345.com | www.bh22678.com | 11989j.com | 2767l.com | 00773i.com | 80892vv.com | 507767.com | haocaipiao.net | hg3211.org | 61652h.com | 79889t.com | www.390706.com | www.610181.com | www.cp994.com | www.xcn1.com | www.3668n.com | www.18593.com | www.60108q.com | www.83033x.com | www.ya2019p.com | www.6613644.com | www.68993221.com | www.5859118.com | www.99094k.com | www.32031c.com | www.074546.com | www.296395.com | www.4058ee.com | www.w32939.com | www.s32939.com | www.5516008.com | www.50999a.com | www.499904.com | www.38345j.com | www.365088.bet | www.00772a.com | www.55060h.com | www.6880ss.com | www.hgdc600.com | www.62979.com | www.89386.com | www.11599111.com | www.81608c.com | www.0601r.com | www.182323.com | www.61233n.com | www.66730.cc | www.okw2.com | www.824879.com | www.444537.com | www.203552.com | xx888w.com | 30176699.com | 9030d.com | 95066666.com | 2019a.cc | 36401144.com | yqpnwjo.cn | 1443f.com | 4590r.com | js99870.com | 2222k09.com | feicai0440.com | www.yptang.com | www.365815e.com | www.58777d.com | www.hqr8888.com | www.54367.com | www.27363s.com | www.89599x.com | www.79095t.com | www.56011j.com | www.168749.com | www.9928o.com | www.856659.com | www.106267.com | 500000797.com | 90307w.com | 3678h.com | 8977xx.com | 38989y.com | www.xin006.com | www.846622.com | www.00773v.com | www.1764r.com | www.50064z.com | www.c130.vip | www.079776.com | 26444h.com | 88770076.com | 2096f.com | www.8887727.com | www.9679t.com | www.n4042.com | www.115527r.com | www.288963.com | www.hf0668.com | www.51515p.com | 6033t.com | 4775511.com | ww38648.com | www.7435k.com | www.21365cc.com | www.bet365zh.com | www.8080999g.com | www.xj1994.com | www.158cp.com | www.202812.com | b01311.com | 41188855.com | js75f.com | www.9999304.com | www.88850.com | www.365002.cc | www.ch1018.com | 18775b.com | 22995144.com | f2870.com | www.t8119.com | www.11132.com | www.087n.com | www.86267p.com | www.589744.com | 588lll.cc | lh66d.com | 2418009.com | www.78.tt | www.bwinyz26.com | www.771493.com | www.397411.com | 80368kk.com | 2078t.com | www.1019992.com | www.bet365zh.com | www.56730.com | www.6539x.com | www.168232.com | gs8877.com | 3009z.com | www.mng44.com | www.7225d.com | www.21202z.com | 910088.com | 0621.com | 73567tg20.com | www.xinpujing888.vip | www.102665.com | www.50052n.com | www.167918.com | 70118g.com | xpj28777.com | www.4940w.com | www.68993263.com | www.489770.com | 3522dd.com | xsj027.cc | www.5405006.com | www.183msc.com | www.607269.com | 2017dh.com | 641155.com | www.7788789.com | www.567733.com | www.718322.com | 11665003.com | 2019tt.cc | www.55537.com | www.4323e.com | www.41518e.com | 3513.com | www.h7788s.com | www.627072.com | www.05883.cc | 8790b.com | 2138.com | www.554msc.com | www.hg1245.com | www.193522.com | lll4165.com | www.882589.com | www.yh234a.com | www.hqcp6.com | aaa678.com | 6363t.com | www.983888d.com | www.2875e.com | ylzz577.com | 15920000.com | www.2y932.com | www.08588n.com | 9420a.com | 537.cc | www.wy8008.com | www.3416q.com | 55zz8332.com | 11018q.com | www.dzj.cm | www.810702.com | 5456p.com | www.yh7890.com | www.2848bbb.com | www.341011.com | y7061.com | www.j359.com | www.xhg338.Com | 99306d.com | feicai0556.com | www.xy0027.com | www.cp8001.cc | 5906gg.com | www.db2233.com | www.666207.com | www.357803.com | 32212m.com | www.350558.com | www.7239q.com | 1427.com | www.857558.com | www.178633.com | www.80767u.com | 73055q.com | www.5966uuu.com | www.cmc.cc | c72555.com | www.89hghg.com | www.1429.com? | 7249.com | www.vnsr800.com | www.3421.com | js8800vip.com | 55331xx.com | www.668cp88.com | www.703617.com | 4590ii.com | www.634599.com | www.44qxc.com | c962we3.com | www.274166.com | www.65707h.com | 8006009.com | www.9996vv.com | www.151228.com | 3304mm.com | www.6491p.com | www.4428229.com | xpj677h.com | www.xgmhh.com | www.82439.com | 7335t.com | www.hg2729.com | www.03088.com | 32126o.net | www.gd68.com | www.99677l.com | 6601vip.us | www.306444b.com | www.3668s.com | 610238.com | www.564949.com | www.c3069.com | pj00jj.com | www.70hga.com | www.106572.com | P35ll.com | www.56011u.com | 2hga.com | www.09569l.com | www.77055.com | 11772007.com | www.66442.com | www.985576.com | 13879455.com | www.4058jj.com | n444000.com | www.ab142.com | www.43818x.com | 8383394.com | www.133suncity.com | www.530196.com | 2934.com | www.6664j.com | 0055886.com | www.10050011.com | www.5086f.com | 5856v.com | www.28000r.com | pu65.com | www.63877l.com | www.07163h.com | 3467l.am | www.11tyc.com | 20776688.com | www.2888.so | www.qilc0.com | 76886d.com | www.0600m.cc | 07326666.com | www.767c.cc | www.662358.com | 081792.com | www.870884.com | 8569811x.com | www.56655f.com | 22558332.com | www.8694m.com | www.lin567.com | js802hd.com | www.90365vip.com | 863873.com | www.107015.com | www.43131h.com | www.pu3888.com | www.fcyl1.com | p9602.com | www.02737.com | bwin8f.com | www.g32939.com | 4255zzz.com | www.hg9958.com | www.591015.com | 2019tt.cc | www.50052p.com | mg0500.cc | www.9464gg.com | d08199.com | www.58118d.com | yh888l.com | www.70678d.com | 0077buyu.com | www.bocainews.net |