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:
How can I align it so they are in two straight columns please?
Alignment issue
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
Alignment issue
Set the font to a fixed width type e.g. Courier New
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Alignment issue
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
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
Alignment issue
Cool!
Unfortunately, Vo-Help does't list this method... X#-Help does
Unfortunately, Vo-Help does't list this method... X#-Help does
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Alignment issue
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
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
The Netherlands
robert@xsharp.eu
Alignment issue
Thank you very much Karl-Heinz, that worked brilliantly, and looks much nicer.