System.Windows.Forms.TextBox does not recieve all input

System.Windows.Forms.TextBox does not recieve all input

dirk.westerdijk
Explorer Explorer
790 Views
2 Replies
Message 1 of 3

System.Windows.Forms.TextBox does not recieve all input

dirk.westerdijk
Explorer
Explorer

When I have the following code:

Form1 = New System.Windows.Forms.Form
Textbox1 = New System.Windows.Forms.TextBox
Form1.Controls.Add(Textbox1)
Form1.Show

The spacebar inputs are are going to Inventor instead of the text box. Is there a nice way to send all input to the form (while it has the focus)?

I now turn off all Inventor commands with the code below, but that feels quite rough:

ThisApplication.UserInterfaceManager.ActiveEnvironment.DisabledCommandTypes = 255
0 Likes
Accepted solutions (1)
791 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @dirk.westerdijk.  Instead of using 'Form1.Show', use 'Form1.ShowDialog'.  When you do it that way, it is modal, so it retains focus until closed.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

dirk.westerdijk
Explorer
Explorer

Thank you. Stacking dialogs on top of dialogs works as well I see, so this works entirely as I want. I just didn't realize what this function would do when I went through the API documentation.

0 Likes