Solved

Why wont ASP.net listbox columns wont align

Posted on 2008-10-30
1
812 Views
Last Modified: 2012-05-05
I am creating a form that has a ASP:listbox as a sales receipt containing three columns, I can not get the three column to align, I have the font set to Courier New, the text is being printed Ok, what could be wrong?
Sub printReceipt(ByVal array(), ByVal entries)
        Dim index As Integer
        'Format receipt list box with three columns, 30 x 40 x 20
        Dim strfmt As String = "{0,-30}{1,-40}{2,20}"
        'Clear out receipt list box
        lstReceipt.Items.Clear()
        'Print header for receipt list box
        Call initialiseListbox()
        'Print salse to receipt list box
        For index = 0 To entries - 1
            lstReceipt.Items.Add(String.Format(strfmt, array(index * 3), array(index * 3 + 1), array(index * 3 + 2)))
        Next
        'Print footer for receipt list box
        lstReceipt.Items.Add(String.Format(strfmt, "-------", "------", "----"))
        lstReceipt.Items.Add(String.Format(strfmt, "", "", "TOTAL: " & Session("total")))
    End Sub
 
    Sub initialiseListbox()
        Dim strfmt As String = "{0,-30}{1,-40}{2,20}"
        lstReceipt.Items.Add(String.Format(strfmt, "SPECIES", "WEIGHT", "COST"))
        lstReceipt.Items.Add(String.Format(strfmt, "-------", "------", "----"))
    End Sub

Open in new window

0
Comment
Question by:dearness
1 Comment
 
LVL 1

Accepted Solution

by:
Luke101 earned 125 total points
ID: 22854924
I would try using tables. It's alot easier aligning colums with tables. See if that works
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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