Code to know whether APP / DIALOG BOX is OPEN or CLOSED . . .
All --
Is there a way that code can run when an APP is OPEN or CLOSED within PREMIER or to tell whether an APP / DIALOG BOX is OPEN or CLOSED?
Code placed in
** PREMIER is RUN rather than when the APP is OPENED.
** WORKBENCH switches from the EDIT MODE to the LOAD MODE
Code placed in
** PREMIER is EXITED rather than when the APP is CLOSED.
** WORKBENCH switches from the LOAD MODE to the EDIT MODE
I'd like this bit of code to run once when the DIALOG BOX is OPENED and perhaps a bit of CLEANUP CODE to run when the DIALOG BOX is CLOSED.
Is there a way to make that happen?
Thanks.
-- Matt
Is there a way that code can run when an APP is OPEN or CLOSED within PREMIER or to tell whether an APP / DIALOG BOX is OPEN or CLOSED?
Code placed in
Sub MyControl_Loadseems to run when:
** PREMIER is RUN rather than when the APP is OPENED.
** WORKBENCH switches from the EDIT MODE to the LOAD MODE
Code placed in
Sub Finalizeseems to run when:
** PREMIER is EXITED rather than when the APP is CLOSED.
** WORKBENCH switches from the LOAD MODE to the EDIT MODE
I'd like this bit of code to run once when the DIALOG BOX is OPENED and perhaps a bit of CLEANUP CODE to run when the DIALOG BOX is CLOSED.
Is there a way to make that happen?
Thanks.
-- Matt
0
Best Answer
-
Hi Matt,
You can use these events to track hide/show:Private Sub MyControl_AppLoading() Handles MyControl.AppLoading MsgBox("AppLoading") End Sub Private Sub MyControl_AppUnloading() Handles MyControl.AppUnloading MsgBox("AppUnloading") End Sub
MyControl is derived from UserControl (https://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol(v=vs.110).aspx ), so you can also use any of UserControl events.
Regards,
Yuri
0
Answers
-
Yuri --
Thank you for your reply with CODE EXAMPLES and URL.
I have tried your code and it works GREAT.
Now I can shift some code fromPrivate Sub MyControl_Load
toPrivate Sub MyControl_AppLoading
so the code runs when the APP OPENS.
This will save CLOSING and REOPENING the PREMIER or EDITING and LOADING the PROJECT.
I've scanned the info at the URL and I will revisit it later.
Thanks again.
-- Matt
0 -
All --
FYI . . .
It seems thatPrivate Sub MyControl_AppLoading
runs nicely when an APP is opened from the APPS RIBBON + APPS SECTION + APP BUTTON but it does not seem to run when the APP is started / restarted via the LOAD button within the PROJECT WORKBENCH.
I hope this information is helpful.
-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions