From 17156ca25c4e9f0fe9dad536f1278a73fe33718f Mon Sep 17 00:00:00 2001 From: haru-s Date: Sat, 29 Jun 2024 21:36:26 +0900 Subject: [PATCH] Add shown event to Form class --- source/dfl/form.d | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/dfl/form.d b/source/dfl/form.d index e6c9090..6bb92c8 100644 --- a/source/dfl/form.d +++ b/source/dfl/form.d @@ -2118,6 +2118,7 @@ class Form: ContainerControl, IDialogResult // docmain } show(); + onShown(EventArgs.empty); wmodal = true; for(;;) @@ -2204,6 +2205,8 @@ class Form: ContainerControl, IDialogResult // docmain Event!(Form, CancelEventArgs) closing; /// //EventHandler load; Event!(Form, EventArgs) load; /// + //EventHandler shown; + Event!(Form, EventArgs) shown; /// /// @@ -2248,9 +2251,19 @@ class Form: ContainerControl, IDialogResult // docmain if(!hwfocus || !IsChild(hwnd, hwfocus)) _selectNextControl(this, null, true, true, true, false); } + + if (isHandleCreated) + onShown(EventArgs.empty); } + /// + protected void onShown(EventArgs ea) + { + shown(this, ea); + } + + private void _init() { _recalcClientSize();