[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Problems with list box and Zone Output

I am trying to set up a list box population when a button is clicked. As I started to enter the headers all that shows up is the first entry repeated 5 times.

I attached a picture of what the output looks like on the button click and the code I used.

Any help would be appreciated, This is driving me nuts!
Thanks!

Private Sub displayStockBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles displayStockBtn.Click
        Dim fmtStr As String = "{0,-25}{0,15:N0}{0,15}{0,15:N3}{0,15:N2}"
        lstOutput.Items.Clear()
        lstOutput.Items.Add(String.Format(fmtStr, "", "Number", "Date", "Purchase", "Current"))
        lstOutput.Items.Add(String.Format(fmtStr, "Stock", "of Shares", "Purchased", "Price/Share", "Price/Share"))
        lstOutput.Items.Add(String.Format(fmtStr, "====================", "==========", "==========", "==========", "=========="))
    End Sub

Open in new window

output.bmp
0
Cloud_Sublime
Asked:
Cloud_Sublime
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Your string pattern should look like this....

    Dim fmtStr As String = "{0,-25}{1,15:N0}{2,15}{3,15:N3}{4,15:N2}"

Wayne
0
 
Cloud_SublimeAuthor Commented:
Thanks for catching that!!! Man I feel quite sheepish...been messing with that for an hour or so now! Ahh well chalk that one up as a learning experience! :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now