You can read more about how subroutines work here http://www.mjtnet.com/manual/srt.htm?zo ... ghtsub=srt
There is no property setting to center the text of a list box.
I'm not sure what look you are going for. I've modified your dialog to open in the center of the screen with the list box in the center of the dialog and removed Goto>Start since it's not needed.
Code: Select all
Dialog>Dialog2
object Dialog2: TForm
Left = 362
Top = 132
HelpContext = 5000
AutoSize = True
BorderIcons = []
BorderStyle = bsSingle
Caption = ' Data Listing'
ClientHeight = 180
ClientWidth = 132
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = True
Position = poScreenCenter
ShowHint = True
OnTaskBar = True
PixelsPerInch = 96
TextHeight = 13
object MSListBox1: tMSListBox
Left = 0
Top = 0
Width = 132
Height = 180
ItemHeight = 13
TabOrder = 0
SelectedIndex = -1
end
end
EndDialog>Dialog2
AddDialogHandler>Dialog2,MSListBox1,OnClick,ShowMe
GetFileList>C:\Datalist\*.txt,theList,CRLF
StringReplace>theList,C:\Datalist\, ,strNewString
StringReplace>strNewString,.txt,,strNewString
SetDialogProperty>Dialog2,MSListBox1,Text,strNewString
Label>Start
Show>Dialog2,r
SRT>ShowMe
GetDialogProperty>Dialog2,MSListBox1,SelectedItems,SelectedText
SetDialogProperty>Dialog2,,Visible,False
Trim>SelectedText,result
If>result=
SetDialogProperty>Dialog2,,Visible,True
END>ShowMe
ENDIF
MessageModal>result
Exit>0
END>ShowMe