Page 1 of 1

How to do a strikethrough text in a GUI text component

Posted: 05 Feb 2023, 03:43
by TheBeginner
there are some methods out there on how to do a strike through text in a GUI text component, some methods I have seen
  • replace the letters with the equivalent pre-strike through unicode letters
  • use an image with the text already strike through
But there is a method of doing that without using pre-strike unicode letters, or images. it is possible to achieve just by using Gui text that will give you greater control.

first make sure that's your ahk script is saved with utf-8 with BOM
then you'll be able to use "—" character that creates a - like line just without the additional spaces to the left and right of that line

Working exampl

Code: Select all

#SingleInstance, force
Gui, margin, 40 40
Gui, Add, text, , Some text
Gui, Add, text, xp-1 yp+1 BackgroundTrans , ————————
Gui, show

Re: How to do a strikethrough text in a GUI text component

Posted: 09 Feb 2023, 07:30
by swagfag
https://www.autohotkey.com/docs/v1/lib/Gui.htm#Font
just set the font to strikethrough

Re: How to do a strikethrough text in a GUI text component

Posted: 16 Jul 2024, 17:59
by Peabianjay
Both solutions are good. They each have benefits and disadvantages.

Do this with "Font" (if you can!)

Code: Select all

Gui, Add, text, , Some text
Gui, Add, text, xp-1 yp+1 BackgroundTrans , ///////////
Often, the 'hardway' also has the benefit of learning techniques which can be applied to other stuff.
For example:

Code: Select all

	Gui, Add, Progress,	w50 h50	Backgroundblue 	center Disabled
	Gui, Add,     Text, xp  yp wp   hp  cred BackgroundTrans 	Center,  % text