[Closed] dotNet tabControls align vertical?
yeah i just took the headers to keep the .net as small as possible as i have to maintain compatibility to max8, as i switch between AX and .net and only use the header of the TC.
didn’t know you couldn’t colorize the header, do you know if you can do that with the other one?
as i’m not that fluent in .net, would i have to install that dll or whatever it’s contained in in the system or is it kinda plug n play?
Yes – setting the .backColor on TabControlEx will color both the content background as well as the header background. In fact, I’m not sure how one might separate the two (short of the custom drawing, again)… though for your purposes where you’re only actually using the tab headers, that might not be a big issue.
( Though if you’re only using the tab headers, does that mean you do your own displaying/hiding of controls to simulate the pages? Yikes? … and if so, you could go all the way and simulate the headers with image buttons or imgtags )
Not really ‘install’ it, but it does have to be placed somewhere that 3ds Max can access it.
pretty much, you just load it from maxscript from wherever you decide storing it, and then use the classes, objects, etc. inside as you would any standard .NET bits. e.g.
dotNet.loadAssembly "c:\\3dsmax11\\TabControlEX.dll"
rollout roll_test "test" width:400 height:200 (
dotNetControl dnc_tabcontrol "Dotnetrix.Controls.TabControlEX" width:380 height:180
)
createDialog roll_test
dn_color = (dotNetClass "System.Drawing.Color")
roll_test.dnc_tabcontrol.backColor = dn_color.transparent
roll_test.dnc_tabcontrol.appearance = (dotNetClass "Dotnetrix.Controls.TabAppearanceEX").Bevel
roll_test.dnc_tabcontrol.tabPages.add "Hello"
roll_test.dnc_tabcontrol.tabPages.Item[0].backColor = dn_color.red
roll_test.dnc_tabcontrol.tabPages.add "World"
roll_test.dnc_tabcontrol.tabPages.Item[1].backColor = dn_color.blue
roll_test.dnc_tabcontrol.refresh()
you can also use the devexpress tabcontrol, it have some cool feature, like header gradient
try (destroydialog roll_test) catch()
(
dotnet.loadAssembly (getdir #maxroot + "\\DevExpress.XtraEditors.v7.1.dll")
--//--
rollout roll_test "test" width:400 height:200 (
dotNetControl dnc_tabcontrol "DevExpress.XtraTab.XtraTabControl" width:380 height:180
)
--//--
createDialog roll_test
--//--
roll_test.dnc_tabcontrol.headerlocation=roll_test.dnc_tabcontrol.headerlocation.left
roll_test.dnc_tabcontrol.lookandfeel.style=roll_test.dnc_tabcontrol.lookandfeel.style.Style3D
roll_test.dnc_tabcontrol.lookandfeel.usedefaultlookandfeel=false
roll_test.dnc_tabcontrol.lookandfeel.usewindowsxptheme=false
roll_test.dnc_tabcontrol.appearancepage.header.backcolor=(dotnetclass "system.drawing.color").SlateGray
roll_test.dnc_tabcontrol.appearancepage.header.backcolor2=(dotnetclass "system.drawing.color").white
roll_test.dnc_tabcontrol.appearancepage.pageclient.backcolor=(dotnetclass "system.drawing.color").SlateGray
roll_test.dnc_tabcontrol.appearancepage.pageclient.backcolor2=(dotnetclass "system.drawing.color").white
roll_test.dnc_tabcontrol.appearancepage.headeractive.backcolor=(dotnetclass "system.drawing.color").gold
roll_test.dnc_tabcontrol.appearancepage.headeractive.backcolor2=(dotnetclass "system.drawing.color").red
roll_test.dnc_tabcontrol.borderstylepage=roll_test.dnc_tabcontrol.borderstylepage.simple
roll_test.dnc_tabcontrol.showheaderfocus=roll_test.dnc_tabcontrol.showheaderfocus.false
roll_test.dnc_tabcontrol.name="roll_test.dnc_tabcontrol"
--//--
NewTab1=roll_test.dnc_tabcontrol.TabPages.Add()
NewTab1.text="World"
NewTab1.name="NewTab1"
--//--
NewTab2=roll_test.dnc_tabcontrol.TabPages.Add()
NewTab2.text="Hello"
NewTab2.name="NewTab2"
)
martin
nice
cringes at all the drawing.colors
-- yum
fn dotnetcolor r g b = ( (dotNetClass "System.Drawing.Color").fromArgb r g b )
rollout roll_test "test" (
dotNetControl dnc_button1 "Windows.Forms.Button" width:48 height:16
)
createDialog roll_test
roll_test.dnc_button1.backColor = (dotnetcolor 255 128 64)
-- yum!
-- (the parentheses are not required but it means less mental switching of
-- languages when it looks more like a standard maxscript (color r g b) def.
-- then again - why didn't they make (color r g b) translate on the fly? :curious: )
oh i’ll definately look into this, thx.
do you btw know how to load a custom AX object? like the .net Struct Methods you know, would be great to know.
thx in advance
I don’t think you can easily load activex components – they have to be installed/registered to Windows before you can use them. You might be able to do that from within 3ds Max, but I wouldn’t have the foggiest where to even begin.
hmm yeah im afraid i have to register thm in the OS before…
well… i now made my own little tabcontroll, out of buttons and images
and disintegrated .net and ax, i should’ve done that from the beginning.
thx for the help guys
haha… yeah, sounded like that’d be the way to go if you were doing your own ‘page’ behavior anyway