Alignment in Edit control Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Alignment in Edit control

Post by newbieforever » 25 Apr 2020, 10:32

How to align the text in an Edit control to right? The options right or 0x2 work only if the text fits into the Edit box, if the text is longer, it is left aligned.

Code: Select all

;Gui, Add, Edit, w200 r1 0x2   vvEdit
Gui, Add, Edit, w200 r1 right vvEdit
Gui, Show, w230

FileSelectFile, File

GuiControl, , vEdit, %File%

Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Alignment in Edit control  Topic is solved

Post by Odlanir » 25 Apr 2020, 12:20

Code: Select all

Gui, Add, Edit, w200 r1 vvEdit hwndEDI
Gui, Show, w230
GuiControl, , vEdit, 000aaaaaaaaaaaaa bbbbbbbbbbbb ccccccccccccccccc dddddddd eeeeeeeeee ffffffffff 9999
SendMessage, 0xB1, -2, -1, , % "ahk_id" EDI ; "0xB1", EM_SETSEL 
return
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

newbieforever
Posts: 493
Joined: 24 Aug 2016, 03:34

Re: Alignment in Edit control

Post by newbieforever » 25 Apr 2020, 17:04

Thanko you, Odlanir, this works perfectly!

Post Reply

Return to “Ask for Help (v1)”