Notifications
Clear all

[Closed] No input in Dotnet textbox – DotNetObject Form

Hi,

I have a problem with Dot Net form inputbox, dont know how to put it in “focus”, when typing keys, max is reading them as hotkeys in 3dsmax interface. I have read some posts about textboxes, but it looks like I have to use Max Rollout or dotNetObject “MaxCustomControls.MaxForm” …

Second problem is toplevel property, how to make form to stick in 3ds max. Setting toplevel=true it works as toplevel for whole windows.

 

theform = dotnetobject "form"
theTexbox = dotnetobject "textbox"
theform.controls.add theTexbox
    dnKeys=dotnetclass "System.Windows.Forms.Keys"
    theKey=false

   fn SetInFocus =
   (
   theTexbox.focus()
theTexbox.IsAccessible ---
   print theTexbox.text
   )

   dotnet.addEventHandler theTexbox "click" SetInFocus
theform.show()


Best Regards
Eryk

2 Replies

Use enableAccelerators=false,below codes should work:


theform = dotnetobject "form"
--------------------------------------------
theform.TopMost=true
--------------------------------------------
theTexbox = dotnetobject "textbox"
theform.controls.add theTexbox
dnKeys=dotnetclass "System.Windows.Forms.Keys"
theKey=false
fn SetInFocus =
(
--------------------------------------------
enableAccelerators=false
--------------------------------------------
theTexbox.focus()
theTexbox.IsAccessible ---
print theTexbox.text
)
dotnet.addEventHandler theTexbox "click" SetInFocus
theform.show()

It works like a charm, thank you very much