You would use the form load event. If this is not showing in your code you can simply select it using the drop down lists at the top of your code window.
Pick (Form1 Events) in the left hand drop-down box (Form1 or whatever your form is called)
Pick Load from the right-hand drop-down box
The event handler code will then appear in your code listing like this:
See here for explanation of how to create form load event
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
In this handler you can put:
ComboBox1.MaxDropDownItems = 10
And it will look like this in the event handler:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ComboBox1.MaxDropDownItems = 10
End Sub
Meaning when the form loads the maximum amount of items the drop down will show out of your list of 30 or 40 will be 10.
Quite simple.
No comments:
Post a Comment