Code: Select all
gui add, text, xp yp wp hp cWhite Center 0x200 BackgroundTrans, EXAMPLE
For instance, the three lines
EXAMPLE
EXAMPLE
EXAMPLE
have to be added in the middle of a Gui window.
Code: Select all
gui add, text, xp yp wp hp cWhite Center 0x200 BackgroundTrans, EXAMPLE
Code: Select all
Gui, Add, Text,, EXAMPLE`nEXAMPLE`nEXAMPLE
I have tried adding ‘n to the beginning of the text which is to start on a new line, but the text is not started on a new line.
Code: Select all
Gui, +AlwaysOnTop -Caption
Gui, Add, Picture, w1280 h900, F:\Data\zzMacroinstr\Scripts\reminders and actions\_image.jpg
Gui, Font, s70, Arial Black
gui add, text, xp yp wp hp cWhite Center 0x200 BackgroundTrans, EXAMPLE `nEXAMPLE
gui show
return
I have deleted the parameter 0x200 from the script. Now the two words are displayed one below the other in the middle. However, they are displayed at the top of the window. Is it possible to display the words one below the other in the center of the window, as in the picture below?mikeyww wrote: ↑16 Aug 2022, 12:53Debugging is easy, because you started with a working script, made several changes without testing each of them, and ended with a broken script. Start over, and add one change at a time; retest until it breaks. You then have your answer. Try deleting 0x200 as a start.
Thank you for the instructions. They deal with individual controls. But it seems as if there is no way to put more than one line of text automatically in the center. A user has to specify exact locations.mikeyww wrote: ↑17 Aug 2022, 11:24Yes. You would like to know how to specify x and y for a GUI or GUI controls. See:
https://www.autohotkey.com/docs/commands/Gui.htm#PosSize
and
https://www.autohotkey.com/docs/commands/Gui.htm#Show
Get a control's position & size: https://www.autohotkey.com/docs/commands/GuiControlGet.htm#Pos
Move or resize a control: https://www.autohotkey.com/docs/commands/GuiControl.htm#Move