Hello,
Thanks for the help, but that's not what I want.
I want to display the ID and the Name in a drop down list. If the ID is less than 10, then I want 2 empty spaces in between the ID and the Name. However, if the the ID is greater than 9, then I want only one empty space in between the ID and the Name.
For example:
9 Hello
15 World
Thanks,
Benny
Main Topics
Browse All Topics





by: morphinexPosted on 2003-09-15 at 21:34:48ID: 9368105
I'm not certain what you are asking... for answering, I'd assume that you want to leave two empty items (empty strings) between each real item. If that's the case, then you probably won't want to be able to select the empty items. So, with that in mind, I did a quick sample of what it might be like.
nged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexCha nged dex / 3)) Box1.Selec tedIndex). ToString = "" Then
ded)
----
Private Sub ComboBox1_SelectedIndexCha
Dim theSelected As Integer = CInt((ComboBox1.SelectedIn
If ComboBox1.Items.Item(Combo
ComboBox1.SelectedIndex = (theSelected * 3)
End If
End Sub
Private Sub addItem(ByVal itemAdded As String)
ComboBox1.Items.Add("")
ComboBox1.Items.Add("")
ComboBox1.Items.Add(itemAd
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
addItem(Me.TextBox1.Text)
End Sub
-----
Let me know if it helps.