Alignment issue

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
Anonymous

Alignment issue

Post by Anonymous »

Hi again... I'm having trouble where I have a method filling a Listbox, with the following code:

METHOD SMSList() Class Datawindow
LOCAL i
LOCAL aRay as ARRAY
LOCAL cStr
LOCAL dbClients as DBSERVER
dbClients := Regos{}
dbClients:GoTop()

aRay := {}

FOR i := 1 to dbClients:RECCOUNT
cStr := PadR(AllTrim(dbClients:FIELDGET(#REGNO)),20, CHR(32)) + " " + PadR(AllTrim(dbClients:FIELDGET(#SMS)),10, CHR(32))
AAdd(aRay, cStr)
dbClients:Skip()
next i

return aRay


Problem is, it looks like this:
Capture.JPG
Capture.JPG (36.16 KiB) Viewed 234 times
How can I align it so they are in two straight columns please?
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm

Alignment issue

Post by lumberjack »

Set the font to a fixed width type e.g. Courier New
BiggyRat

Alignment issue

Post by BiggyRat »

Brilliant, thank you Sir. I suspected it would be something simple....
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Alignment issue

Post by Karl-Heinz »

Hi Jeff,

The listbox class has the method SetTabs(aTabs), so there´s no reason to switch to a fixed-width font. To make SetTabs() work:

- set the Listbox painter property "Use Tab Stops" to true
- insert a tab char in your string
- set the tab position.

cStr := AllTrim(dbClients:FIELDGET(#REGNO)) + chr(9) + AllTrim(dbClients:FIELDGET(#SMS))

<oLB>:SetTabs ( { 90} ) increase/decrease the position until it fits your needs.

regards
Karl-Heinz
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Alignment issue

Post by FFF »

Cool!
Unfortunately, Vo-Help does't list this method... X#-Help does ;-)
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Alignment issue

Post by robert »

Karl,
The X# help is generated from the assemblies and that means that all methods are included unless we explicitely tell the the doc generator to skip a method.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
BiggyRat

Alignment issue

Post by BiggyRat »

Thank you very much Karl-Heinz, that worked brilliantly, and looks much nicer.
Post Reply