Modify

Opened 16 years ago

Closed 16 years ago

#1722 closed Bug (No Bug)

GUICtrlSetStyle() and $BS_DEFPUSHBUTTON

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

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).

Attachments (0)

Change History (1)

comment:1 by Valik, 16 years ago

Resolution: No Bug
Status: newclosed

This is not a bug. You need support so either use the forum, or more appropriately, Google. It took me about 3 minutes to find a working solution for changing the default button in a dialog.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.