|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
When I add items to a listbox and the listox fills up with items a scrollbar appears on the
right side of the listbox so that I can scroll down the list to see the Items that do not appear. My question for the forum, is there a way for the Listbox to always display the last items that were added to the listbox. I would like for my listbox to scroll down automatically when a new item is added. Thanks, Darryl |
|
#2
|
||||
|
||||
|
Quote:
"Me.ListBox1.SelectedIndex = Me.ListBox1.Items.Count - 1" on the form load event will open the form and advance the list to the last item in the list. For better list management, you could create a table in a database which holds the values and controls how the items should appear in the list. For instance, adding a timestamp field to the record, you could use the timestamp to deterimine if an item is "new" to the list or not. |
|
#3
|
|||
|
|||
|
List box
I have had the same problem, the way I went about it was like this: Since I was pulling my data from a database table I moved the pointer to the last item in the table, then wrote a Do While Not BOF (begining of file) loop to populate the combo box (I used a combo box instead of a list box)
Sample code: Private Sub GetTrks() 'This Sub routine gets the truck number from field Turck_Numb of Table 'Truck_List in the TruckingUSA database and loades it to the combo box trucks. On Error GoTo Quit Set rsMyDbWindow = dbTrucking.OpenRecordset("Truck_List", dbOpenDynaset) 'Name of Table rsMyDbWindow.MoveLast 'This is a loop to populate the combo box Do While Not rsMyDbWindow.BOF cboTrucks.AddItem rsMyDbWindow!Truck_Numb cboWTrkNo.AddItem rsMyDbWindow!Truck_Numb cboHistTrks.AddItem rsMyDbWindow!Truck_Numb rsMyDbWindow.MovePrevious Loop Quit: End Sub |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Listbox question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|