[Closed] .NET form docking as max rollout?
hi guys, i want to create a dotnetform and it can dock as maxrollout toolbar
in maxscript use cui.[font=‘Courier New’]RegisterDialogBar <rollout> [/font]
but how to use it in .net ?
does anyone know it ? thanks
Does your method work with windows 7 Aero enabled? There is an ongoing bug where docked maxscript or .net buttons in a standard rollout don’t respond with certain aero features switched on.
This is a small test file I passed on to Autodesk, which they confirmed as not working with Aero with no work around possible (according to them).
the script doesn’t do much except print to the listener if clicks are recognised. right click the maxscript button to undock.
Cheers
Mikie
hey Mikie. i actually worked this one out a while ago. you need to add #style_resizing to the style array, then the buttons become responsive again. and since you probably don’t want people to resize your dialog, use lockWidth:true and lockHeight:true with the createDialog function. see your code modified below:
try(cui.UnRegisterDialogBar btnTest)catch()
try(destroyDialog btnTest)catch()
rollout btnTest "dotnet button test"
(
local docked = false
local Ccolor = dotnetclass "system.drawing.color"
button normalButton "mxs" height:20 width:40 across:3
dotNetControl testButton "button" height:20 width:40
button btn_dock "dock" height:20 width:50
fn undock=
(
try(cui.UnRegisterDialogBar btnTest)catch()
try(destroyDialog btnTest)catch()
)
on testButton MouseDown do (print "dotNet";)
on normalButton rightClick do undock()
on normalButton pressed do (print "Mxs";)
on btn_dock pressed do
(
if docked then
(
cui.UnRegisterDialogBar btnTest
btn_dock.text = "dock"
)
else
(
size = [200 + 15, 25 + 3]
cui.RegisterDialogBar btnTest minSize:size maxSize:size style:#(#cui_dock_top)
cui.DockDialogBar btnTest #cui_dock_top
btn_dock.text = "undock"
)
docked = NOT docked
)
on btnTest open do
(
testButton.flatStyle=testButton.flatStyle.flat
testButton.text="dotNet"
testButton.backColor=testButton.backColor.lightBlue
testButton.flatappearance.mouseoverbackcolor = Ccolor.green
testButton.flatappearance.mousedownbackcolor = Ccolor.red
testButton.flatappearance.bordercolor = Ccolor.yellow
dnFontStyle = dotNetClass "System.Drawing.FontStyle"
myFontStyle = dotnet.combineenums dnFontStyle.bold dnFontStyle.italic
testButton.font = dotNetObject "System.Drawing.Font" "Arial" 10 dnFontStyle.italic
)
)
createDialog btnTest width:200 height:25 [b]lockWidth:true lockHeight:tru[/b]e style:#(#style_toolwindow, #style_sysmenu, #style_border, [b]#style_resizing[/b])
Awesome!!! You’re the best, as always!
Autodesk ADN support couldn’t figure that one out.