Notifications
Clear all

[Closed] How to bound a form to the 3dsmax application?

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

5 Replies

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()
)

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

Ho sorry, my mistake,
I was setting the Form.TopMost to true

anyways thank for your help mate :applause:
Martin Dufour

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 But since I had that code right here, It was faster than writing a new one Cheers!

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

regard,
Martin Dufour