Addin, VB.NET: Check if form is already open

Addin, VB.NET: Check if form is already open

Patrick1323
Enthusiast Enthusiast
3,159 Views
1 Reply
Message 1 of 2

Addin, VB.NET: Check if form is already open

Patrick1323
Enthusiast
Enthusiast

Hello,

I'm want to check if a form in a inventor instance is already open. Can I use OpenForms to accomplish that? This code is in the StandardAddInServer.vb, so it's not a standalone application.

2016-10-13 07_51_31-IVTBFSchweißteil (Debugging) - Microsoft Visual Studio.png

0 Likes
Accepted solutions (1)
3,160 Views
1 Reply
Reply (1)
Message 2 of 2

NachoShaw
Advisor
Advisor
Accepted solution
Well, if your form called let's say 'MainForm', you could do the following:

Dim f as form = New MainForm
Select Case f.Visible
Case True
MsgBox ("your form is open")
Case False
MsgBox ("your form is not open")
End Select

Always make sure that when you open the form, you open it as New



Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes