Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error:As soon as you enter the enter key, a new winform appears

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
2208571753
310 Views, 2 Replies

Error:As soon as you enter the enter key, a new winform appears

2208571753
Enthusiast
Enthusiast

When i enter the enter key,a new winform appears,but i didn't write these codes.

 

My code :

Private WithEvents ButtonLogin As ButtonDefinition

ButtonLogin = controlDefs.AddButtonDefinition("Login",
"ButtonLogin",
CommandTypesEnum.kShapeEditCmdType,
AddInClientID,
"Login",
"Login",
smallIcon,
largeIcon)

 

Private Sub ButtonLogin_OnExecute(Context As NameValueMap) Handles ButtonLogin.OnExecute
Dim f1 As New FormLogin
f1.Show()
End Sub

 

When enter the enter key in FormLogin windows,a new FormLogin appears,just like the screenshot below.

20220615084603.png

Why is this happening?

Error:As soon as you enter the enter key, a new winform appears

When i enter the enter key,a new winform appears,but i didn't write these codes.

 

My code :

Private WithEvents ButtonLogin As ButtonDefinition

ButtonLogin = controlDefs.AddButtonDefinition("Login",
"ButtonLogin",
CommandTypesEnum.kShapeEditCmdType,
AddInClientID,
"Login",
"Login",
smallIcon,
largeIcon)

 

Private Sub ButtonLogin_OnExecute(Context As NameValueMap) Handles ButtonLogin.OnExecute
Dim f1 As New FormLogin
f1.Show()
End Sub

 

When enter the enter key in FormLogin windows,a new FormLogin appears,just like the screenshot below.

20220615084603.png

Why is this happening?

Labels (5)
2 REPLIES 2
Message 2 of 3
Michael.Navara
in reply to: 2208571753

Michael.Navara
Advisor
Advisor
Accepted solution

In my opinion when you use f1.Show(), the code continues (exit the method). And when you press enter, Inventor repeats the last command -> show new form.

Try to change the call to f1.ShowDialog(). This wait until the form is closed.

In my opinion when you use f1.Show(), the code continues (exit the method). And when you press enter, Inventor repeats the last command -> show new form.

Try to change the call to f1.ShowDialog(). This wait until the form is closed.

Message 3 of 3
2208571753
in reply to: Michael.Navara

2208571753
Enthusiast
Enthusiast
thanks for your help!
0 Likes

thanks for your help!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report