Note that there are some explanatory texts on larger screens.

plurals
  1. POputting multiple arrays into one single ListBox
    primarykey
    data
    text
    <p>I am trying to put multi arrays into a single listbox. Below is the code. It works well when I make every output go into its own listBox but I am trying to but them all in one listbox with the current headings. Can someone help? One last thing, I would also like the duplicate values to go into another column but don't know how. All I can due is just eliminate the duplicates (want to go above and beyond and show what numbers were eliminated)</p> <pre><code>Public Class Form1 Dim randomNum As New Random() Dim SampleArray(19) As Integer Dim aryNums() As Integer = SampleArray Dim distinctNums = SampleArray.Distinct() Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() For i = 0 To 19 SampleArray(i) = randomNum.Next(10, 100) ListBox1.Items.Add(SampleArray(i).ToString) Next Array.Sort(SampleArray) For i = 0 To SampleArray.GetUpperBound(0) ListBox2.Items.Add(SampleArray(i)) Next For Each num In distinctNums ListBox3.Items.Add(num.ToString()) Next End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click ListBox4.Items.Add("Index" &amp; vbTab &amp; "Random" &amp; vbTab &amp; "Sorted" &amp; vbTab &amp; "Unique") For i = 0 To 19 SampleArray(i) = randomNum.Next(10, 100) ListBox4.Items.Add(i &amp; vbTab &amp; SampleArray(i).ToString) 'ListBox4.Items.Add(SampleArray(i).ToString) Next Array.Sort(SampleArray) For i = 0 To SampleArray.GetUpperBound(0) ListBox4.Items.Add(vbTab &amp; vbTab &amp; SampleArray(i)) Next For Each num In distinctNums ListBox4.Items.Add(vbTab &amp; vbTab &amp; vbTab &amp; num.ToString()) Next End Sub End Class </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload