How can I write a dialog

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
laurenince525
Newbie
Posts: 1
Joined: Fri Mar 26, 2021 1:13 pm

How can I write a dialog

Post by laurenince525 » Fri Mar 26, 2021 4:16 pm

Hi,
I’m new to MS. How can I write a dialog with only a Memo box to display the contents of a .txt file?
I do not want any “Button” or “Enter” key to trigger the display of the txt file. We want to try to use it with our new employee monitoring software
Last edited by laurenince525 on Mon Mar 29, 2021 4:58 pm, edited 1 time in total.
"Cleanliness becomes more important when godliness is unlikely."

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 885
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: How can I write a dialog

Post by Dorian (MJT support) » Fri Mar 26, 2021 4:27 pm

Have you looked at these yet, just to get the fundamentals?

https://help.mjtnet.com/article/40-an-i ... dal-dialog

https://help.mjtnet.com/article/41-an-i ... t-handlers

This does what you need :

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 2322
  Top = 431
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 504
  ClientWidth = 636
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -28
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 240
  TextHeight = 32
  object MSMemo1: tMSMemo
    Left = 37
    Top = 20
    Width = 548
    Height = 429
    Text = ''
    VertScrollBarStyles.ButtonSize = 43
    HorzScrollBarStyles.ButtonSize = 43
    TabOrder = 8
  end
end
EndDialog>Dialog1

//Read a text file
ReadFile>d:\MyFile.txt,FileContents

//Put the file contents in the memo box
SetDialogProperty>Dialog1,MSMemo1,Text,%FileContents%

//Display Dialog
Show>Dialog1,res




Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts