title: I want to get the most frequently clicked button as an item in the listbox
body: <p>I'm trying to make in which there are a series of buttons. Each button is clicked, then theres is a label beside it which records the count of hits the button gets. </p>
  
  <p>Then I am able to get the greatest integer from that collection (greatest number of times a button was clicked). So I get the number, I'm confused on how to associate the highest number to the most clicked button so that I can automatically add an item in a listbox which shows the most frequently used button.</p>
  
  <pre><code>//////--Code to import the greatest integer of all the collection (clicked more times)---
  
  `Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As `enter code here`System.EventArgs) Handles Button1.Click
  1.  Dim nums() As Integer = {x1.Text, x2.Text, x3.Text, x4.Text, x5.text}
  2.     Dim qry = From n As Integer In nums Order By n Descending
  3.        For Each n As Integer In qry
  4.            listbox1.Items.Add(n)
  5.  Next
  6. End Sub`
  
  
  //////---code to get the single number which was greater than every other in the collection///-
  
  `Private Sub Button2_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  1. Dim nums() As Integer = {x1.Text, x2.Text, x3.Text, x4.Text, x5.text}
  2. Dim qry = From n As Integer In nums Order By n Descending
  3.        Dim res As Integer = nums.Max.ToString
  4.        For Each i As Integer In nums
  5.            If i &gt; res Then res = i
  6.            Label120.Text = res.ToString
  7.        Next
  8.        Return
  9. End Sub`
  </code></pre>