PDA

View Full Version : Dotnet steal focus


MerlinEl
03-16-2012, 03:11 PM
Hi

I' found something strange in Dotnet form.
When I'm pressing a button to use a simple tool, then I can't use it.
Only when I'm switch max window out and back, then is start work normally... :banghead:

I'm tried the same script for both interfaces , Max and Dotnet.
Here is examples.


--Max works

rollout focusTestDialog "Max Focus Test" width:196 height:124
(
button btn1 "create point" pos:[80,44] width:88 height:32
on btn1 pressed do
(
tool create (on mousePoint click do point pos:gridPoint wirecolor:green)
startTool create
)
)
createDialog focusTestDialog


--Dotnet failed

--DotNet Interface
(
local form = dotNetObject "MaxCustomControls.Maxform"
local btn = dotNetObject "button"
form.Text = "Dotnet Focus Test"
btn.text = "create point"
form.bounds = dotnetObject "Drawing.Rectangle" 200 400 196 124
fn onMouseUp s a =
(
tool create (on mousePoint click do point pos:gridPoint wirecolor:green)
startTool create
)
dotNet.addEventHandler btn "MouseUp" onMouseUp
form.controls.add btn
form.showModeless()
)


It is only on my Pc , or you get the same result?
I'm using 3DsMax 2012

Kickflipkid687
03-16-2012, 08:35 PM
I've run into this I think. I was trying to use a mousetool via C# UI, and it wouldn't start unless I first did something like, max Move, then called the script I believe.

This way it gave focus back to the max window, and worked.

Give that a shot?

MerlinEl
03-19-2012, 12:54 PM
It works :thumbsup:
Greate! you are good! Thanks Man :beer:

CGTalk Moderation
03-19-2012, 12:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.