birchy Posted October 10, 2003 Posted October 10, 2003 Ok so i know you can do it nut how?: a drop down box that you can enter data into to search and enter your own data. http://www.faceparty.com/public/588/images/mrbirchy_3746115.jpg please say someone can help. Quote
techmanbd Posted October 10, 2003 Posted October 10, 2003 Combobox Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
birchy Posted October 10, 2003 Author Posted October 10, 2003 yeah but you cant edit the text with a combo box. Quote
whosyodaddy Posted October 11, 2003 Posted October 11, 2003 yeah but you cant edit the text with a combo box. Of course you can... It's all in the code:) Edit The Properties, If It's not there then there definately is code. Quote
*Experts* Volte Posted October 11, 2003 *Experts* Posted October 11, 2003 To do the searching bit, you need to code it yourself. Here's a bit of code I wrote to do it (just put this in your keypress event of the combo):If Not (e.KeyChar = ControlChars.Back) And _ Not (e.KeyChar = ControlChars.Tab) And _ (cbo.Text.Length > 0) Then Dim itemIndex As Integer = -1 Dim i As New String Dim index As Integer = 0 For Each i In cbo.Items If i.ToUpper.StartsWith(cbo.Text.ToUpper) Then itemIndex = index Exit For End If index += 1 Next If itemIndex > -1 Then Dim oldText As String = cbo.Text cbo.Text &= cbo.Items(itemIndex).Substring(cbo.Text.Length) cbo.SelectionStart = oldText.Length cbo.SelectionLength = cbo.Text.Length - oldText.Length End If End IfYou'll obviously need to modify cbo to fit the name of your combo. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.