﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1722	GUICtrlSetStyle() and $BS_DEFPUSHBUTTON	anonymous		"{{{
Opt(""GUIOnEventMode"", 1)

$g = GUICreate(""gui"")
$i = GUICtrlCreateInput("""",2,2)
$b = GUICtrlCreateButton(""click me"",220,2)
GUICtrlSetStyle($b, 0x50034001);defpushbutton

GUICtrlSetOnEvent($b, ""_button"")
GUISetOnEvent(-3, ""_Close"")
GUISetState()

While 1
    Sleep(100)
WEnd

Func _button()
    MsgBox(0,"""",""Yay!"")
EndFunc

Func _Close()
    Exit
EndFunc
}}}


The button event should be triggered whenever I press the enter key but it isn't.

It works if I set the defpushbutton style in the GUICtrlCreateButton() function but I need to set reset the style many times in my script (when the first style is not $BS_DEFPUSHBUTTON). "	Bug	closed		AutoIt	3.3.6.0	None	No Bug		
