How to do a strikethrough text in a GUI text component

Helpful script writing tricks and HowTo's
TheBeginner
Posts: 91
Joined: 19 Oct 2018, 12:05

How to do a strikethrough text in a GUI text component

Post by TheBeginner » 05 Feb 2023, 03:43

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


Post Reply

Return to “Tutorials (v1)”