[AccessD] Right Justify in List Box

William Hindman wdhindman at dejpolsystems.com
Wed Feb 17 14:02:39 CST 2010


...Consolas is installed with any Vista or Office 2007 install and above.
...it can be downloaded from MS
...it is specifically designed to be used with Clear Type on LCD screens 
where it is imnsho very clear
...try turning on Clear Type and tuning it using the Consolas font

William

--------------------------------------------------
From: "Max Wanadoo" <max.wanadoo at gmail.com>
Sent: Wednesday, February 17, 2010 2:49 PM
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Right Justify in List Box

> Here is what I have  come up with.  Code is dead simple and easy.  It all
> centres on the Fonts being used for the List Box.
>
> No twips  or  twerps.
>
> I have a LIST BOX with 3 columns. Col 1 is text. Col2 is Credits.  Col3 is
> Debits.
>
> I needed to have the currency line up as normal, right justified in cols 2
> and 3.
>
> There may be other Fonts.  I would  appreciate if you guys can tell me if
> this font come as-is on your PCs.  I have not installed it but it may have
> been  put on my system via other software.
>
> DETAILS:-
>
> Font is:  Consolas (Thanks to Dan Waters for this tip)
> Pitch is: 8
>
> Text is not very good but it is  readable.
>
> BUT the numeric values line up like  soldiers on parade.  And that is my
> aim.
>
> These fonts also might work: BatangChe, @MS Gothic
>
> Here is the code below.
>
> Max
>
>
>
>
> Private Function fJustifyText(ByVal Amount As Currency) As String
>    Dim iLen As Integer, strAmount As String, lVal As Long
>    lVal = Int(Abs(Amount))
>    strAmount = CStr(Amount)
>    If Abs(Amount) - Int(Abs(Amount)) = 0 Then strAmount = Int(strAmount) &
> ".00"
>    iLen = Len(strAmount)
>    'see if the formatting will insert any "," and allow for them to a 
> range
> I am happy with
>    iLen = iLen + Switch(lVal >= 1000000000, 3, lVal >= 1000000, 2, lVal >=
> 1000, 1, lVal >= 0, 0)
>    ' default spacing for my list box is 12
>    fJustifyText = String(12 - iLen, Chr(160)) & Format(Amount, "#,##0.00")
> ' Chr(160) on  my system is invisible and has been on all my systems to
> date.  YMMV
> End Function
>
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list