DotNet Panel in Max Dialog: Weird margin outside of panel


#1

I’m wanting to switch over to using DotNet exclusively for my UI, but embed them in a standard Max dialog so I have the ability to dock to the Max UI.

One issue I’m having is that I can’t get a DotNet Panel or ContainerControl to to completely fill the dialog. When the control is at 0,0, there’s actually a 13 pixel gap on the left, and a 5 pixel gap on the top. However the control is able to spread out all the way to the right and bottom of the Max dialog. This isn’t the end of the world, but I really don’t want such an unsightly waste of UI space.

DotNetDialog

try(destroyDialog testRoll)catch()
rollout testRoll “Test” (

dotNetControl cc "ContainerControl"

on testRoll open do (		
	testRoll.resizeFloater()
)

on testRoll resized dims do (
	testRoll.resizeFloater()
)

fn resizeFloater=(		
	cc.width=testRoll.width-13
	cc.height=testRoll.height-5	
)

)
createDialog testRoll width:300 height:200 style:#(#style_toolwindow, #style_sysmenu, #style_border, #style_resizing)


#2
try(destroyDialog testRoll)catch()
rollout testRoll "Test" width:300
(
	dotNetControl cc "ContainerControl" pos:[1,1]

	fn resizeControlPanel = 
	(		
		sz = getdialogsize testRoll
		w = cc.width = sz.x - 2
		h = cc.height = sz.y/2
		
		[w,h]
	)
	
	on testRoll resized size do 
	(
		resizeControlPanel()
	)

	on testRoll open do 
	(		
		resizeControlPanel()
	)
)
createDialog testRoll height:200 bgcolor:orange style:#(#style_toolwindow, #style_sysmenu, #style_border, #style_resizing)

if you do everything right it should work


#3

Ahhhhh, ok. So I just needed to set the position of the control during creation using #pos. Thanks!