Hello together,
I have a form which I open with an add-in. When the user trys to open the form again and the form is open and minimized the form should came back to it's original size and normal.
Public Function FormIsLoaded(ByVal sName As String) As Boolean Dim bResult As Boolean = False ' alle geöffneten Forms durchlauden For Each oForm As Form In System.Windows.Forms.Application.OpenForms If oForm.Name.ToLower = sName.ToLower Then bResult = True : Exit For End If Next Return (bResult) End Function
Private Sub oButtonDefinition287_Vault_OnExecute(Context As NameValueMap) Handles oButtonDefinition287_Vault.OnExecute Dim MyLocalForm As New Form_Vault If Not FormIsLoaded("Form_Vault") Then MyLocalForm.Show(New WindowWrapper(m_inventorApplication.MainFrameHWND)) 'Das Form wird an das Fenster von Inventor gebunden Else ShowWindow(MyLocalForm.WindowState, SHOW_WINDOW.SW_NORMAL) End If End Sub
How could I do this?
Thanks
Georg
Solved! Go to Solution.
Solved by dudde.giridhar. Go to Solution.
Solved by YuhanZhang. Go to Solution.
could you please explain this a little more?
seems that you are not using Form.showdialog or Form.show, but I am not sure of it.
Regards
Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
With:
MyLocalForm.Show(New WindowWrapper(m_inventorApplication.MainFrameHWND))
I bind the form on Inventor. But how could I bring it to the top?
There is a good explanation:
https://forums.autodesk.com/t5/inventor-customization/converting-autocad-bas-to-inventor/td-p/761770
use form.showdialog.
form.hide
form.show
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
This is used for parenting a dialog to the Inventor window.
Hoping that below blog suggestions may be helpful.
http://arsalantamiz.blogspot.com/2008/11/setting-window-form-position.html
Thanks and regards,
Hello @chandra.shekar.g, @bradeneuropeArthur,
sorry but I could not bring the form up, when the user has minimized the Inventor application child form. The parent form is maximized.
Hello @chandra.shekar.g,
there is a sample code. Not a good one but it shows the problem.
Thank you
Georg
If I understand correct, you can do it like below to bring the form back to top of Inventor UI when it is minimized:
1. In Windows task bar click the Inventor button to show the preview button.
2. Click the form preview button to bring it back to top of Inventor.
But a suggestion is, in your sample project you use Form.ShowDialog which creates a modal dialog in Inventor, usually we don't need the Maximize/Minimize buttons for the dialog, so if no special reason you can just hide them, i.e. set the MaximizeBox and MinimizeBox to False in the Properties panel. And also I recommend to set the ShowInTaskbar to False if you hide the maximize and minimize buttons:
Hello @YuhanZhang,
the problem is to bring the form back by programming not by a click from the user.
Then can you tell me do you want a modal dialog or modaless dialog? And why you allow users to minimize the dialog? I want to understand what is your requirement for the dialog behavior.
MyLocalForm.ShowDialog(New WindowWrapper(m_inventorApplication.MainFrameHWND))
The user should do some work when the form is minimized. But the form should come up, when the user clicks the function again. Sometimes the user didn't see the form when it's minimized.
If you use the ShowDialog, the form is modal then you can't interact with Inventor no matter the form is minimized or not, so I just want to know what workflow you design it that your customers need to minimize the form? And with a modal dialog showed you can't click the button again unless you dispose the modal form. So in this case the users manually minimize the form and then they need to manually restore it from the task bar. This is why I suggest to just hide the Minimize&Maxmize buttons on the form, and this is also the case for most of Inventor built-in dialogs(modal & modaless dialogs). Hope this explains.
I updated your project and attached, you can try if it is what you want.
Hello guys,
This window wrapper is not working for WPF forms.
Can anyone suggest how to proceed further ?
Regards,
D.Giridhar
Can't find what you're looking for? Ask the community or share your knowledge.