Create a simple dialog with memo box

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
nskd
Newbie
Posts: 15
Joined: Wed May 29, 2019 2:02 pm

Create a simple dialog with memo box

Post by nskd » Wed May 29, 2019 2:11 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.
To put it simply, when the dialog is launched, it will immediately show the contents of the text file.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Create a simple dialog with memo box

Post by Marcus Tettmar » Wed May 29, 2019 5:36 pm

Just do exactly that. Create a custom dialog. Put only a memo box on it.

Prior to showing the dialog load the file into a variable using ReadFile and then set the text of the memo with this variable using SetDialogProperty.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

nskd
Newbie
Posts: 15
Joined: Wed May 29, 2019 2:02 pm

Re: Create a simple dialog with memo box

Post by nskd » Tue Jun 04, 2019 3:02 pm

Thanks, manage to solve it following your advice

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