PDA

View Full Version : How to bound a form to the 3dsmax application?


martroyx
10-14-2008, 08:07 PM
Hi, does someone know how to bound a .net form to the 3dsmax application, so that other windows, like the material editor can get on top on it ?

Thank,
Martin Dufour

Kameleon
10-14-2008, 08:34 PM
Is this it?

(
local hForm = dotNetObject "MaxCustomControls.MaxForm"
hForm.Size = dotNetObject "System.Drawing.Size" 290 290
hForm.FormBorderStyle = (dotnetclass "System.Windows.Forms.FormBorderStyle").FixedToolWindow
hForm.Text = ""
hForm.ShowInTaskbar = False

local lstview1 = dotNetObject "System.Windows.Forms.ListView"
lstview1.backcolor=(dotnetclass "System.Drawing.Color").DarkCyan
lstview1.location=dotNetObject "System.Drawing.Point" 10 10
lstview1.name="lstview1"


local lstview2 = dotNetObject "System.Windows.Forms.ListView"
lstview2.location=dotNetObject "System.Drawing.Point" 150 10
lstview2.name="lstview2"

local lstview3 = dotNetObject "System.Windows.Forms.ListView"
lstview3.location=dotNetObject "System.Drawing.Point" 10 150
lstview3.name="lstview3"

local lstview4 = dotNetObject "System.Windows.Forms.ListView"
lstview4.location=dotNetObject "System.Drawing.Point" 150 150
lstview4.name="lstview4"


hform.controls.add(lstview1)
hform.controls.add(lstview2)
hform.controls.add(lstview3)
hform.controls.add(lstview4)



seed(timestamp())
for i=1 to 20 do
(
lstview1.items.add ((random 1 256) as string)
lstview2.items.add ((random 1 256) as string)
lstview3.items.add ((random 1 256) as string)
lstview4.items.add ((random 1 256) as string)
)

hForm.ShowModeless()
)

martroyx
10-14-2008, 08:39 PM
Exactly, that work perfectly but, I don't get it, I'm doing the exact same thing ?

the only thing that seam strange is this : seed(timestamp()) ... what does it do ?

thank for help,
Martin Dufour

martroyx
10-14-2008, 08:44 PM
Ho sorry, my mistake,
I was setting the Form.TopMost to true :-P

anyways thank for your help mate :applause:
Martin Dufour

Kameleon
10-14-2008, 08:49 PM
That's correct, if you use TopMost=true then the form will be on top of all other Max windows. About the seed(timestamp()) that's just for randomizing the numbers I'm adding to the listboxes, doesn't have anything to do with what you were asking :P But since I had that code right here, It was faster than writing a new one :P Cheers!

martroyx
10-14-2008, 08:59 PM
I was setting it to topmost because with :


(
form1 =(Dotnetobject "System.Windows.Forms.Form")
form1.show()
)


the form was send to the back of 3dsmax :-(
so I just guessed it was the same with the ShowModeless() thing :-P

regard,
Martin Dufour

CGTalk Moderation
10-14-2008, 08:59 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.