Is there a way to adjust the alignment of the DropDownList item?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Is there a way to adjust the alignment of the DropDownList item?

15 Jun 2019, 10:18

Hello,

Is there a way to adjust the alignment of the DropDownList item?

For example, in the following example, is it possible to align the items text vertically in the center?

Thanks.

Code: Select all

Gui, Add, DropDownList, w300 hwndDDL vColorChoice, Black|White|Red|Green|Blue
PostMessage, 0x153, 0, 30,, ahk_id %DDL%
Gui, Show, h300 w400
return
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Is there a way to adjust the alignment of the DropDownList item?

15 Jun 2019, 10:33

If there isn't. You can always use a mono space font and pad the left side of your list.
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Is there a way to adjust the alignment of the DropDownList item?

15 Jun 2019, 13:43

Code: Select all

Gui, font,,Courier
Gui, Add, DropDownList, w300 hwndDDL vColorChoice, % SpaceItems("Black|White|Red|Green|Blue")
PostMessage, 0x153, 0, 30,, ahk_id %DDL%
Gui, Show, h300 w400
return

SpaceItems(items) {
   for each, item in StrSplit(items, "|") {
      lng := StrLen(item)
      str .= Format("{:-" 17-lng/2 "}{}"," ",item) "|"
   }
   return Substr(str,1,-1)
}
ExitApp
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: Is there a way to adjust the alignment of the DropDownList item?

16 Jun 2019, 04:39

Thank you. This should be horizontal center alignment, not vertical center alignment, right?
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Is there a way to adjust the alignment of the DropDownList item?

16 Jun 2019, 04:47

@afe You're right! Seems I've misunderstood your request. But what you mean by vertical alignment?
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, Descolada, inseption86, mikeyww and 380 guests