How to use this button style Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pneumatic
Posts: 338
Joined: 05 Dec 2016, 01:51

How to use this button style

21 Oct 2017, 09:16

Image

Notice how the OK button has square edges and no shadow through its face like a regular button does which looks more like this:

Image

On Windows 10 I believe the above image will have square edges as well, however that doesn't mean there aren't two different styles in effect and I would like to use the one in the first picture.

I have tried all the styles in the help file, notably BS_FLAT 0x8000 Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D effect. , however it has no effect. The other styles do work so I don't believe it's an error on my part.

Thanks
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: How to use this button style

21 Oct 2017, 13:40

Did you try ControlGet Style/ExStyle? It might reveal the difference.

Code: Select all

q::
vCtlClassNN := "Button1"
ControlGet, vCtlStyle, Style,, % vCtlClassNN, A
ControlGet, vCtlExStyle, ExStyle,, % vCtlClassNN, A
MsgBox, % Format("0x{:08X} 0x{:08X}", vCtlStyle, vCtlExStyle)
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: How to use this button style  Topic is solved

21 Oct 2017, 14:25

Add -theme to the control's options.

Sample:

Code: Select all

GUI, Add, Button, W100 -theme, % "Square"
GUI, Add, Button, W100, % "Regular"
GUI, Show
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
pneumatic
Posts: 338
Joined: 05 Dec 2016, 01:51

Re: How to use this button style

22 Oct 2017, 19:20

Thank you SirRFI that works. :clap:
jeeswg wrote:Did you try ControlGet Style/ExStyle? It might reveal the difference.

Code: Select all

q::
vCtlClassNN := "Button1"
ControlGet, vCtlStyle, Style,, % vCtlClassNN, A
ControlGet, vCtlExStyle, ExStyle,, % vCtlClassNN, A
MsgBox, % Format("0x{:08X} 0x{:08X}", vCtlStyle, vCtlExStyle)
return
Thanks. ControlGet is showing styles 0x00000004 and 0x50030001 for me, but neither of them result in the style unfortunately.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], jameswrightesq and 157 guests