PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
ComboBox DroppedDown questions
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
ComboBox DroppedDown questions
![]() |
ComboBox DroppedDown questions |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
VB.NET 2003. I am loading a dialog box form with a ComboBox. I'm
using a DropDownStyle of "DropDown" rather than "DropDownList". I want them to be able to type in it fill in as they type. The ComboBox contains a list of cities. The form will receive a parameter of one alpha-numeric character. I want to do two things (that I don't know how to do): 1. The parameter received to be moved to the ComboBox and the cursor to be positioned at the end of the character. So they can continue to type and have the city filled in. I can get the ComboBox.Text to be the value of the parameter. But the field is selected. I cannot get it unselected. So they have the type the character a second time. 2. The list box part of the ComboBox dropped down. I can get it to drop down. But the list box part then goes back up. I'm guessing it is because the form is loading. I've tried putting the code in the Form Activated event, but that didn't help. Any suggestions? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Try this code.
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.ComboBox1.DroppedDown = True Me.ComboBox1.Text = "" Me.ComboBox1.Focus() SendKeys.Send("S") 'set an S into the combobox End Sub ================= Clay Burch Syncfusion, Inc. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks Clay. I had thought of that too, but wanted to avoid it. I
don't like using the SendKeys command. You can never really know how the keys are going to be sent. But it did work and I'm going with it for now. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

