title: Listbox String format not the same of the console output
body: <p>I have this form who contain a listbox</p>
  
  <pre><code>    Public Class Item
      Private sList As List(Of Container)
  
      Sub New(ByRef sList As List(Of Container))
          InitializeComponent()
  
          Me.sList = sList
      End Sub
  
      Private Sub Item_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  
          For Each c As Container In sList
              ListBox1.Items.Add(c)
          Next
  
  
          ListBox1.DataSource = sList
          ListBox1.DisplayMember = "sItem"
      End Sub
  End Class
  </code></pre>
  
  <p>This would be the class containter</p>
  
  <pre><code>Public Class Container
  
      Private _sItemName As String
      Private _sPrice As Single
      Private _iNumber As Integer
      Private _sItemString As String
  
      Sub New(ByVal _sItemName As String, ByVal _sPrice As Single, ByVal _iNumber As Integer, ByVal _sItemString As String)
          Me._sItem = _sItemName
          Me._sPrice = _sPrice
          Me._iNumber = _iNumber
          Me._sItemString = _sItemString
      End Sub
  
      Public Property sItemName() As String
          Get
              Return _sItemName
          End Get
          Private Set(value As String)
              _sItemName = value
          End Set
      End Property
  
      Public Property sItemString() As String
          Get
              Return _sItemString
          End Get
          Private Set(value As String)
              _sItemString = value
          End Set
      End Property
  
      Public Property sPrice() As Single
          Get
              Return _sPrice
          End Get
          Private Set(value As Single)
              _sPrice = value
          End Set
      End Property
  
      Public Property iNumber() As String
          Get
              Return _iNumber
          End Get
          Private Set(value As String)
              _iNumber = value
          End Set
      End Property
  
  End Class
  </code></pre>
  
  <p>And there's where I add it to the output</p>
  
  <pre><code>Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Dim dgv As DataGridView = DataGridView1
      Dim rowIndex As Integer = dgv.SelectedRows(0).Index
  
      Dim _sItem As String = ""
      Dim _iNumber As Integer = TextBox1.Text
      Dim _sPrice As Single = dgv.Rows(rowIndex).Cells("Prix").Value * TextBox1.Text
  
      Dim format As String = "{0, -10} {1, -10} {2, 5}"
  
      _sItem = String.Format(format, dgv.Rows(rowIndex).Cells("Nom").Value.ToString, _sPrice.ToString("C2"), _iNumber.ToString)
  
      Console.WriteLine(_sItem)
      Dim container As New Container(_sItem, _sPrice, _iNumber, dgv.CurrentRow.Cells("Nom").Value.ToString)
  
      If (updateDGV(container) = True) Then
          sList.Add(container)
      End If
  
      TextBox1.Clear()
      TextBox1.Focus()
      updateLabel()
  End Sub
  </code></pre>
  
  <p>So my question is why the output on the lsitbox is like this
  <img src="https://i.stack.imgur.com/j27NV.png" alt="enter image description here"></p>
  
  <p>And the console output is</p>
  
  <p><img src="https://i.stack.imgur.com/TWXyA.png" alt="enter image description here"></p>
  
  <p>What I want is the listbox output be the same as the console but the format seems to not work and I have no idea from there on how I should make this work I could use some help and explanation on why the listbox is not showing the text properly</p>
  
  <p>To be sure i'm clear : Is there a way to make the listbox output look the same of the console output</p>
  
  <p>Edit : ListView</p>
  
  <p>THe things as you can see the data are binded so if I do so</p>
  
  <p>Container Access from listbox</p>
  
  <pre><code>        Dim obj As Object = ListBox1.SelectedItem
  
      If (TypeOf obj Is Container) Then
          Dim c As Container = CType(obj, Container)
  
          Console.WriteLine(c.iNumber)
      End If
  </code></pre>
  
  <p>it can return me the object when I select one row, that's what I don't know how to do with the list view and the adding ( The for each <code>Items.add(c)</code> I don't know the equivalent for a listview)</p>