Skip to content

Commit

Permalink
Improved: Setting the default property of a CommandButton sets or uns…
Browse files Browse the repository at this point in the history
…ets the DefaultButton property of the parent Form.
  • Loading branch information
XusinboyBekchanov committed Aug 16, 2022
1 parent 31a7061 commit b339138
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mff/CommandButton.bas
Expand Up @@ -92,8 +92,12 @@ Namespace My.Sys.Forms
#ifdef __USE_GTK__
gtk_widget_set_can_default(widget, Value)
#elseif defined(__USE_WINAPI__)
'ChangeStyle BS_PUSHLIKE, False
ChangeStyle BS_PUSHLIKE, False
ChangeStyle BS_DEFPUSHBUTTON, Value
Dim As Control Ptr frm = This.GetForm
If frm Then
frm->FDefaultButton = IIf(Value, @This, 0)
End If
#endif
End If
End Property
Expand Down

0 comments on commit b339138

Please sign in to comment.