I am working on porting a VB6 application to .NET and one of the desired UI elements is a horizontal listbox. I can't seem to figure out how to replicate this in .NET.
Can this be done with basic winforms?
How would you replicate this?
Sample:
The VB6 code that will replicate the above image:
Private Sub Form_Load()
lst_horizontal(1).FontSize = 6
Dim iMaxChoices As Integer
iMaxChoices = 10
For i = 1 To iMaxChoices
lst_horizontal(1).AddItem (" " + CStr(i))
Next i
End Sub
Private Sub lst_horizontal_Click(Index As Integer)
Dim iMaxChoices As Integer
iMaxChoices = 10
For i = 0 To iMaxChoices - 1
If lst_horizontal(1).Selected(i) Then
Debug.Print ("Item " + CStr(i + 1) + " selected")
End If
Next i
Weasel words: I can figure out how to replicate this in Silverlight/XAML, but this app can't be done in that fashion.
I would suggest the ListView
with LargIcon
for View
property, It might be a good and ready solution for your case.
Good luck!
This is supported in Winforms as well. Set the MultiColumn property to True, the ColumnWidth property to, say, 15. Producing:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With