?
Solved

Problems with list box and Zone Output

Posted on 2009-03-30
2
Medium Priority
?
219 Views
Last Modified: 2012-05-06
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
Comment
Question by:Cloud_Sublime
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 24018225
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
 

Author Closing Comment

by:Cloud_Sublime
ID: 31564301
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question