How to make a horizontal list in .NET.

I am working on porting a VB6 application to .NET, and one of the necessary user interface elements is a horizontal list. I cannot figure out how to replicate this in .NET.

  • Can this be done using basic winforms?

  • How would you replicate this?

Example:
alt text

Code VB6 that will play 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 

Lava words: I can understand how to copy this into Silverlight / XAML, but this application cannot be done that way.

+6
winforms
source share
2 answers

This is also supported in Winforms. Set the MultiColumn property to True, the ColumnWidth property, say 15. Producing:

enter image description here

+2
source share

I would suggest a ListView with LargIcon for the View property. This can be a good and ready-made solution for your business.

alt text

Good luck

+4
source share

All Articles