GUI text auto width wrap? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

GUI text auto width wrap?

05 Jan 2022, 01:06

With the following experiment, I want the text auto-wrap according to the window/edit, but it fails. Could anybody please give me a hand?

Code: Select all

gui,2: add,edit,w300
gui,2: add,text,-wrap vInfotext,if you pushed something wrong,manually delete it in ini file,notice they're in pair.
gui,2: show

GuiControlGet, Size, 2:Pos, Infotext
SizeW += 10			; a little breathing room
if SizeW > 780
	SizeW = 780
if SizeW < 250
	SizeW = 250
GuiControl, 2:Move, Infotext, % "w" SizeW

Return
User avatar
jmeneses
Posts: 524
Joined: 28 Oct 2014, 11:09
Location: Catalan Republic

Re: GUI text auto width wrap?

05 Jan 2022, 04:20

I don't know if I understand it well

Code: Select all

gui,2: add,edit,w300
gui,2: add,text,-wrap vInfotext ,if you pushed something wrong,manually delete it in ini file,notice they're in pair.
gui,2: show

Loop 3                          ; example repeated three times
{
GuiControlGet, Size, 2:Pos, Edit1
SizeW += 10 * A_Index			; a little breathing room
if SizeW > 780
	SizeW = 780
if SizeW < 250
	SizeW = 250
Sleep 600
GuiControl, 2:Move, Edit1, % "w" SizeW
}
Return              

Donec Perficiam
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

05 Jan 2022, 06:32

jmeneses wrote:
05 Jan 2022, 04:20
I don't know if I understand it well

Code: Select all

gui,2: add,edit,w300
gui,2: add,text,-wrap vInfotext ,if you pushed something wrong,manually delete it in ini file,notice they're in pair.
gui,2: show

Loop 3                          ; example repeated three times
{
GuiControlGet, Size, 2:Pos, Edit1
SizeW += 10 * A_Index			; a little breathing room
if SizeW > 780
	SizeW = 780
if SizeW < 250
	SizeW = 250
Sleep 600
GuiControl, 2:Move, Edit1, % "w" SizeW
}
Return              

Thanks for your help. I want the text wrapped according to the width of the edit box. Now I begin to realize it's not a so good idea.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: GUI text auto width wrap?

05 Jan 2022, 14:38

Did you try leaving Wrap on? i.e Don't use -Wrap

Code: Select all

MyText := "if you pushed something wrong,manually delete it in ini file, notice they're in pair."

Gui, +AlwaysOnTop
Gui, Add, Edit, w300 r1
Gui, Add, Text, w300 , % MyText

Gui, Show,, Wrap Text
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: GUI text auto width wrap?

05 Jan 2022, 15:46

joshatt wrote:
05 Jan 2022, 01:06
With the following experiment, I want the text auto-wrap according to the window/edit, but it fails. Could anybody please give me a hand?
.............

Hi, try this

Code: Select all

InfotextWrap := "-"
InfotextW := ""

begin:
gui,2: add, edit, x10 w300
gui,2: add, text, x10 y+5 %InfotextW% %InfotextWrap%wrap vInfotext, if you pushed something wrong,manually delete it in ini file,notice they're in pair.

GuiControlGet, Size, 2:Pos, Infotext
if SizeW > 300
{
	gui,2: Destroy
	InfotextWrap := "+"
	InfotextW := "w300"
	gosub begin
}
gui,2: show
Return

2GuiClose:
ExitApp
:wave: There is always more than one way to solve a problem. ;)
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: GUI text auto width wrap?

05 Jan 2022, 16:19

YoucefHam wrote:
05 Jan 2022, 15:46

Hi, try this
Forgive my ignorance here, but why would you do it that way instead of just setting the width of the text control the the same size of the edit control
while allowing the text to Wrap on it's own?
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: GUI text auto width wrap?

05 Jan 2022, 16:32

Hellbent wrote:
05 Jan 2022, 16:19
Forgive my ignorance here, but why would you do it that way instead of just setting the width of the text control the the same size of the edit control
while allowing the text to Wrap on it's own?
Hi, sorry to confuse you :crazy:,
its the same but I just delivered what he asked.

Code: Select all

gui,2: add, edit, x10 w300
gui,2: add, text, x10 y+5 w300 +wrap vInfotext, if you pushed something wrong,manually delete it in ini file,notice they're in pair.
gui,2: add, Button, x10 y+5 w300, Button
gui,2: show
Return

2GuiClose:
ExitApp
:wave: There is always more than one way to solve a problem. ;)
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

05 Jan 2022, 18:21

Hellbent wrote:
05 Jan 2022, 14:38
Did you try leaving Wrap on? i.e Don't use -Wrap
......
Thank you, sir. I did not understand minus sign well - sometimes I'm confused, like "+center", I tested and found no difference from without plus sign.
Hellbent wrote:
05 Jan 2022, 16:19
would you do it that way instead of just setting the width of the text control the the same size of the edit control
while allowing the text to Wrap on it's own?
I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: GUI text auto width wrap?

05 Jan 2022, 19:03

joshatt wrote:
05 Jan 2022, 18:21
Hellbent wrote:
05 Jan 2022, 14:38
Did you try leaving Wrap on? i.e Don't use -Wrap
......
Thank you, sir. I did not understand minus sign well - sometimes I'm confused, like "+center", I tested and found no difference from without plus sign.

Normally you don't need to add the + sign to your options, but it can help to make things more clear.

Here is an example of where you do need to use the + sign, but it is only needed for the first option. Any option that follows it doesn't explicitly need it.

Code: Select all


Gui, 2: AlwayOntop   ;This WILL cause an error.
Gui, 2: +AlwaysOnTop ;This  WON'T  cause an error.

;*******************************************************************************

Gui, 2: HwndHwnd AlwaysOnTop ;This WILL cause an error.
Gui, 2: +HwndHwnd AlwaysOnTop ;This WON'T cause an error


Hellbent wrote:
05 Jan 2022, 16:19
would you do it that way instead of just setting the width of the text control the the same size of the edit control
while allowing the text to Wrap on it's own?
I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable.
There are loads of cases where you would need to do something similar to the whole GuiControlGet, Var , Pos.
It could be that in your case you will want to do something along those lines, but they would be specific to the use case.

I would recommend making a post about your specific case so that you can get the solution for it.

For example, resizing a control has potential side effects that would need to be addressed and how you address them will depend on a number of factors.
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

05 Jan 2022, 19:42

Hellbent wrote:
05 Jan 2022, 19:03
Here is an example of where you do need to use the + sign, but it is only needed for the first option. Any option that follows it doesn't explicitly need it.
......
Thanks a lot, you're so helpful.
Hellbent wrote:
05 Jan 2022, 16:19
There are loads of cases where you would need to do something similar to the whole GuiControlGet, Var , Pos.
It could be that in your case you will want to do something along those lines, but they would be specific to the use case.

I would recommend making a post about your specific case so that you can get the solution for it.

For example, resizing a control has potential side effects that would need to be addressed and how you address them will depend on a number of factors.
You're right, sometimes I mix up my solving process.
Appreciate it!
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

06 Jan 2022, 01:30

YoucefHam wrote:
05 Jan 2022, 16:32
Hellbent wrote:
05 Jan 2022, 16:19
Forgive my ignorance here, but why would you do it that way instead of just setting the width of the text control the the same size of the edit control
while allowing the text to Wrap on it's own?
Hi, sorry to confuse you :crazy:,
its the same but I just delivered what he asked.

Code: Select all

gui,2: add, edit, x10 w300
gui,2: add, text, x10 y+5 w300 +wrap vInfotext, if you pushed something wrong,manually delete it in ini file,notice they're in pair.
gui,2: add, Button, x10 y+5 w300, Button
gui,2: show
Return

2GuiClose:
ExitApp
Thank you so much for your help. I did not make myself clear. After some test, I successfully scraped up this following code, which fully tells my purpose:

Code: Select all

content=Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim.
gui, new
gui,+resize +lastfound
Gui, Add, edit, w400 hwndHCTL,                   try re-code width of this edit
GuiControlGet, P, Pos, %HCTL%
Gui, Add, Text, +Wrap r3 w%PW% vFollowEdit,      %content%
Gui, Add, Text, +Wrap r3 w%PW% vFollowWindow,    %content%
gui,show
Return

Guisize:
guicontrol,movedraw,FollowWindow,w%A_GuiWidth%
Return
I also learned one lesson: text content can not be ONE SINGLE long word, it just don't wrap, must be a sentence. LOL.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: GUI text auto width wrap?

06 Jan 2022, 11:22

@joshatt

I was playing around with this last night, perhaps it will help.

It shows two approaches to get to the same outcome.
I'll take a look at your new code later today.


Example 1:

Code: Select all

#SingleInstance, Force

MyText := "I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable." 

Gui, 1:+AlwaysOnTop +Resize +HwndGui1Hwnd -Caption
Gui, 1:Margin, % M := 10 , 10
Gui, 1:Font, s10 , Arial
Gui, 1:Add, Edit, xm ym w250 r1 +hwndEdit1hwnd ,
Gui, 1:Add, Text, xm y+10 w250 +hwndText1hwnd +Border , % MyText
Gui, 1:Show, Hide , example 1

DetectHiddenWindows, On
WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
DetectHiddenWindows, Off

Gui, 1:+Caption
Gui, 1:Show,, example 1
Gui, % "1: +MinSize" w " +MaxSize750x" h - 16

return
GuiCLose:
*ESC::ExitApp

GuiSize:
	if( !ft && ft := !ft )
		return
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	GuiControl, 1:MoveDraw , % Edit1Hwnd , % " w" ( w - ( M * 2 ) - 15 )
	Gui, FakeGui:Font, s10 , Arial
	Gui, FakeGui:Add, Text, % " w" ( w - ( M * 2 ) - 15 ) , % MyText
	GuiControlGet, pos, FakeGui:pos , Static1
	Gui, FakeGui:Destroy
	GuiControl, 1:MoveDraw , % Text1Hwnd , % " w" posW " h" posH
	if( lw != w || lh != h )
		SetTimer, ShowGui, -100
	lh := h , lw := w
	sleep, 30
	return
	
ShowGui:
	if( !GetKeyState( "LButton" ) ){
		ft := 0
		Gui, 1:Show, AutoSize NA
	}else 
		SetTimer, ShowGui, -100
	return

Example 2:

Code: Select all

#SingleInstance, Force

MyText := "I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable." 

Gui, 1:+AlwaysOnTop +Resize  +MaxSize750 +MinSize250 +HwndGui1Hwnd +ToolWindow
Gui, 1:Margin, % M := 10 , 10
Gui, 1:Font, s10 , Arial
Gui, 1:Add, Edit, xm ym w250 r1 +hwndEdit1hwnd ,
Gui, 1:Add, Text, xm y+10 w250 +hwndText1hwnd +Border , % MyText
Gui, 1:Show,, example 2

return
GuiCLose:
*ESC::ExitApp

GuiSize:
	if( !ft && ft := !ft )
		return
	if( GetKeyState( "LButton" ) ){
		SetTimer, GuiSize, -100
		Sleep, 60
		return
	}
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	GuiControl, 1:MoveDraw , % Edit1Hwnd , % " w" ( w - ( M * 2 ) - 15 )  
	Gui, FakeGui:Font, s10 , Arial
	Gui, FakeGui:Add, Text, % " w" ( w - ( M * 2 ) - 15 ) , % MyText
	GuiControlGet, pos, FakeGui:pos , Static1
	Gui, FakeGui:Destroy
	GuiControl, 1:MoveDraw , % Text1Hwnd , % " w" posW " h" posH
	Gui, 1:Show, AutoSize NA
	return
	
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

07 Jan 2022, 04:47

Hellbent wrote:
06 Jan 2022, 11:22
@joshatt

I was playing around with this last night, perhaps it will help.

It shows two approaches to get to the same outcome.
I'll take a look at your new code later today.


Example 1:

Code: Select all

#SingleInstance, Force

MyText := "I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable." 

Gui, 1:+AlwaysOnTop +Resize +HwndGui1Hwnd -Caption
Gui, 1:Margin, % M := 10 , 10
Gui, 1:Font, s10 , Arial
Gui, 1:Add, Edit, xm ym w250 r1 +hwndEdit1hwnd ,
Gui, 1:Add, Text, xm y+10 w250 +hwndText1hwnd +Border , % MyText
Gui, 1:Show, Hide , example 1

DetectHiddenWindows, On
WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
DetectHiddenWindows, Off

Gui, 1:+Caption
Gui, 1:Show,, example 1
Gui, % "1: +MinSize" w " +MaxSize750x" h - 16

return
GuiCLose:
*ESC::ExitApp

GuiSize:
	if( !ft && ft := !ft )
		return
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	GuiControl, 1:MoveDraw , % Edit1Hwnd , % " w" ( w - ( M * 2 ) - 15 )
	Gui, FakeGui:Font, s10 , Arial
	Gui, FakeGui:Add, Text, % " w" ( w - ( M * 2 ) - 15 ) , % MyText
	GuiControlGet, pos, FakeGui:pos , Static1
	Gui, FakeGui:Destroy
	GuiControl, 1:MoveDraw , % Text1Hwnd , % " w" posW " h" posH
	if( lw != w || lh != h )
		SetTimer, ShowGui, -100
	lh := h , lw := w
	sleep, 30
	return
	
ShowGui:
	if( !GetKeyState( "LButton" ) ){
		ft := 0
		Gui, 1:Show, AutoSize NA
	}else 
		SetTimer, ShowGui, -100
	return

Example 2:

Code: Select all

#SingleInstance, Force

MyText := "I'm still learning, and I begin to realize giving it a width is a better way, especially when there're other controls down below. But on learning purpose, sometimes this text control could be at right side of other control, and I want a good alignment at the right window edge, or, I may want an auto adjusting text control if the window is resizable." 

Gui, 1:+AlwaysOnTop +Resize  +MaxSize750 +MinSize250 +HwndGui1Hwnd +ToolWindow
Gui, 1:Margin, % M := 10 , 10
Gui, 1:Font, s10 , Arial
Gui, 1:Add, Edit, xm ym w250 r1 +hwndEdit1hwnd ,
Gui, 1:Add, Text, xm y+10 w250 +hwndText1hwnd +Border , % MyText
Gui, 1:Show,, example 2

return
GuiCLose:
*ESC::ExitApp

GuiSize:
	if( !ft && ft := !ft )
		return
	if( GetKeyState( "LButton" ) ){
		SetTimer, GuiSize, -100
		Sleep, 60
		return
	}
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	GuiControl, 1:MoveDraw , % Edit1Hwnd , % " w" ( w - ( M * 2 ) - 15 )  
	Gui, FakeGui:Font, s10 , Arial
	Gui, FakeGui:Add, Text, % " w" ( w - ( M * 2 ) - 15 ) , % MyText
	GuiControlGet, pos, FakeGui:pos , Static1
	Gui, FakeGui:Destroy
	GuiControl, 1:MoveDraw , % Text1Hwnd , % " w" posW " h" posH
	Gui, 1:Show, AutoSize NA
	return
	
Marvellous!
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: GUI text auto width wrap?  Topic is solved

08 Jan 2022, 14:40

joshatt wrote:
06 Jan 2022, 01:30
Thank you so much for your help. I did not make myself clear. After some test, I successfully scraped up this following code, which fully tells my purpose:

Code: Select all

content=Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim.
gui, new
gui,+resize +lastfound
Gui, Add, edit, w400 hwndHCTL,                   try re-code width of this edit
GuiControlGet, P, Pos, %HCTL%
Gui, Add, Text, +Wrap r3 w%PW% vFollowEdit,      %content%
Gui, Add, Text, +Wrap r3 w%PW% vFollowWindow,    %content%
gui,show
Return

Guisize:
guicontrol,movedraw,FollowWindow,w%A_GuiWidth%
Return
Try this.

Code: Select all

#SingleInstance, Force
SetBatchLines, -1

Content := "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim."
Content2 := "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim."

GuiMargin := 10 
GuiBorder := 16 * ( A_ScreenDPI / 96 )

Gui, 1:+AlwaysOnTop HwndGui1Hwnd Resize 
Gui, 1:Font, s12 , Segoe UI
Gui, 1:Margin, % GuiMargin , % GuiMargin
Gui, 1:Add, Edit, xm ym w400 r1 hwndEdit1Hwnd, % "try re-code width of this edit"
Gui, 1:Add, Text, % "xm y+" GuiMargin " wp Border cBlue hwndText1Hwnd" , % Content
Gui, 1:Add, Text, % "xm y+" GuiMargin " wp Border cRed hwndText2Hwnd" , % Content2
Gui, 1:Show

GuiMargin *= ( A_ScreenDPI / 96 )

return
GuiClose:
GuiContextMenu:
*ESC::ExitApp


;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
GuiSize:
	
	if( !FT && FT := !FT )
		return
	
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	
	Gui, 1:-DPIScale
	
	GuiControl, 1:MoveDraw, % Edit1Hwnd, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) 
	
	Gui, FakeGui:-DPIScale
	Gui, FakeGui:Font, s12 , Segoe UI
	Gui, FakeGui:Add, Text, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) , % Content
	GuiControlGet, pos, FakeGui:Pos, static1
	Gui, FakeGui:Destroy
	
	GuiControl, 1:MoveDraw, % Text1Hwnd, % "w" posW  " h" posH 
	GuiControlGet, pos, 1:Pos, % Text1Hwnd
	
	GuiControl, 1:MoveDraw, % Text2Hwnd, % "y" posY + posH + GuiMargin 
	
	Gui, FakeGui:-DPIScale
	Gui, FakeGui:Font, s12 , Segoe UI
	Gui, FakeGui:Add, Text, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) , % Content2
	GuiControlGet, pos, FakeGui:Pos, static1
	Gui, FakeGui:Destroy
	
	GuiControl, 1:MoveDraw, % Text2Hwnd, % "w" posW  " h" posH 
	
	Gui, 1: +DPIScale
	
	Sleep, 60
	
	return

;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************

Animation.gif
Animation.gif (386.11 KiB) Viewed 2223 times
joshatt
Posts: 151
Joined: 07 Dec 2014, 08:41

Re: GUI text auto width wrap?

09 Jan 2022, 05:52

Hellbent wrote:
08 Jan 2022, 14:40
Try this.

Code: Select all

#SingleInstance, Force
SetBatchLines, -1

Content := "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim."
Content2 := "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ullamcorper neque eu sapien. Fusce scelerisque magna nec enim."

GuiMargin := 10 
GuiBorder := 16 * ( A_ScreenDPI / 96 )

Gui, 1:+AlwaysOnTop HwndGui1Hwnd Resize 
Gui, 1:Font, s12 , Segoe UI
Gui, 1:Margin, % GuiMargin , % GuiMargin
Gui, 1:Add, Edit, xm ym w400 r1 hwndEdit1Hwnd, % "try re-code width of this edit"
Gui, 1:Add, Text, % "xm y+" GuiMargin " wp Border cBlue hwndText1Hwnd" , % Content
Gui, 1:Add, Text, % "xm y+" GuiMargin " wp Border cRed hwndText2Hwnd" , % Content2
Gui, 1:Show

GuiMargin *= ( A_ScreenDPI / 96 )

return
GuiClose:
GuiContextMenu:
*ESC::ExitApp


;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
GuiSize:
	
	if( !FT && FT := !FT )
		return
	
	WinGetPos,,, w, h, % "ahk_id " Gui1Hwnd
	
	Gui, 1:-DPIScale
	
	GuiControl, 1:MoveDraw, % Edit1Hwnd, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) 
	
	Gui, FakeGui:-DPIScale
	Gui, FakeGui:Font, s12 , Segoe UI
	Gui, FakeGui:Add, Text, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) , % Content
	GuiControlGet, pos, FakeGui:Pos, static1
	Gui, FakeGui:Destroy
	
	GuiControl, 1:MoveDraw, % Text1Hwnd, % "w" posW  " h" posH 
	GuiControlGet, pos, 1:Pos, % Text1Hwnd
	
	GuiControl, 1:MoveDraw, % Text2Hwnd, % "y" posY + posH + GuiMargin 
	
	Gui, FakeGui:-DPIScale
	Gui, FakeGui:Font, s12 , Segoe UI
	Gui, FakeGui:Add, Text, % "w" ( w - ( GuiMargin * 2 ) - GuiBorder ) , % Content2
	GuiControlGet, pos, FakeGui:Pos, static1
	Gui, FakeGui:Destroy
	
	GuiControl, 1:MoveDraw, % Text2Hwnd, % "w" posW  " h" posH 
	
	Gui, 1: +DPIScale
	
	Sleep, 60
	
	return

;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************
;***********************************************************************************************************************************************************

Animation.gif
No doubt, your code is perfect. I'm still trying to learn from it, it's a full package.
I appreciate all the time you spent on this.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Albireo, Bing [Bot], Descolada, koolestani, peter_ahk, skolomir and 126 guests