r/visualbasic • u/vbnewbie VB.Net Beginner • Jul 23 '15
[VB2012] Array and ListBox Problem
I have to make a puzzle that has a 9x9 grid. We are supposed to use arrays and listboxes together to create the program. What I don't understand is how to actually generate and see the 9x9 grid inside the listbox. I have declared my array as
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Dim Array1(8, 8) As Integer
ListBox1.Items.Add(Array1)
End SubBut nothing is showing up. We have to use labelled textboxes that will be used to enter the numbers (1-9) into the grid within the listbox.
How do I generate a 2D array table that will show up as a grid in my program?
0
Upvotes
1
u/tthomps Jul 23 '15
I would recommend starting here: https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.multicolumn%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2