Notifications
Clear all

[Closed] dotNet tabControls align vertical?

Hi Paul,

TabControlEx works fine for me in max 2008 (what version of max were you trying it in?)

Here’s the code I used (based on your code):


dotNet.loadAssembly @"C:\TabControlEX.dll"
try(destroyDialog testR)catch()
 rollout testR "Test" width:200
 (
	 dotNetControl tabs "Dotnetrix.Controls.TabControlEx" height:300
	 
	 fn showProps tab=
	 (
		 clearListener()
		 format "Properties:
"
		 showProperties tab
		 format "
Methods:
"
		 showMethods tab
		 format "
Events:
"
		 showEvents tab
	 )
	 
	 on testR open do
	 (
		 showProps tabs
		 
		tabs.Alignment = tabs.Alignment.Left
		tabs.Appearance = (dotNetClass "Dotnetrix.Controls.TabAppearanceEx").FlatTab
		tabs.BackColor = (dotNetClass "System.Drawing.Color").Transparent
		 tabs.Multiline=true
		 tabs.tabStop=true
		 
		 
		 labels=#("Main", "Settings", "User", "Misc", "Extras")
		for x in labels do 
			tabs.tabPages.add x
	 )
 )
 createDialog testR

I downloaded it from the link you gave.

hOpe this helps,
o

Work in 2009 … this tab controls is very nice, thank :buttrock:

 PEN

Ofer, this is great that you got this running but can you explain how? Here is what I had…

dotNet.loadAssembly ((getDir #scripts)+"\\penProductions\	abControlEx.dll")
 dotNetControl tabs "tabControlEx.dll"

and here is yours…

dotNet.loadAssembly @"C:\TabControlEX.dll"
 dotNetControl tabs "Dotnetrix.Controls.TabControlEx" height:300

So where did the ampersand come from, what does it do and where did you get the path string for creating the control?

Here’s how you can get the available “types” of any loaded assembly:

a = dotNet.loadAssembly @"C:\TabControlEX.dll"
dotNetObject:System.Reflection.Assembly
for t in a.GetTypes() do print t
...
...
dotNetObject:System.RuntimeType[[b]Dotnetrix.Controls.TabControlEX[/b]]
...
...
OK
c = a.CreateInstance "Dotnetrix.Controls.TabControlEX"
dotNetObject:Dotnetrix.Controls.TabControlEX

The @ character marks the string as verbatim meaning that any escape sequences are ignored. So by prefixing the string with @ you can safely type (for example) @“C:\render”. Without the @ the \r would convert to a carriage return character.

Martijn

The ampersand is a new addition in max 2008, and it just allows you to skip the escaping of special characters when typing a string. From the mxs help:
String Literals [left]Verbatim String Literals
[/left]
[left][color=red]NEW in [/color][color=red]3ds Max 2008[/color][color=red]:[/color][color=red][/color]Verbatim string literals added to MAXScript in 3ds Max 2008 are prefixed by the ‘@’ character and are NOT expanded even if containing backslash escape character sequences like ’ ‘, ’
’ or ‘\r’.
[/left]
[left]The syntax is
[/left]
[left]@”{<character>}+”
[/left]
[left]FOR EXAMPLE,
[/left]
[left]
[/left]
[left][color=green]–[/color][color=green]the following verbatim string remains unchanged after evaluation:[/color]
[/left]
[left]thePath = @[color=maroon]“g: emp
ewfolder\render” [/color]
[/left]
[left]
[/left]
[left][color=blue]“g: emp
ewfolder\render”[/color]
[/left]
[left][color=green]–while[/color][color=green] the following results in a [/color]
[/left]
[left][color=green]–scrambled string with tabs and new lines:[/color]
[/left]
[left]thePath = [color=maroon]“g: emp
ewfolder\render” [/color]
[/left]
[left][color=blue]“g: emp[/color]
[/left]
[left][color=blue]ewfolder[/color]
[/left]
[left][color=blue]ender”[/color]
[/left]
[left]
[/left]
[left]

[/left]
So the ampersand is just there to shorten the path, it has nothing to do with the dotNet stuff.

As for the path string for creating the control, since I couldn’t find any documentation for the TAbControlEx class, I used a class browser to see the name of the control, and the methods it has. I used the one in SharpDevelop (because that’s what I usually use for visual designing of forms and a bit of C#), but I’m sure Visual Studio for C# also has this.
I’ve recently found this tool which has a free version and seems very good for class browsing.

hOpe this helps,
o

Hey Martijn,

That’s a cool tip!
Thanks for sharing!

o

Originally Posted by magicm
[i]Here’s how you can get the available “types” of any loaded assembly:
Code:
[left]a = dotNet.loadAssembly @“C:\TabControlEX.dll”
dotNetObject:System.Reflection.Assembly
for t in a.GetTypes() do print t


dotNetObject:System.RuntimeType[Dotnetrix.Controls.TabControlEX]


OK
c = a.CreateInstance “Dotnetrix.Controls.TabControlEX”
dotNetObject:Dotnetrix.Controls.TabControlEX[/left]

Martijn[/i]

I was looking for this for so long…how did you figure this out? :banghead:

another think that bug me out is the .anchor property,
I could say : a.anchor = a.anchor.top
but how to make it top and left at the same time ?

Thanks !!

Martin Dufour

1 Reply
(@ofer_z)
Joined: 11 months ago

Posts: 0

a.anchor = dotNet.combineEnums a.anchor.top a.anchor.left

hOpe this helps,
o

That was quick 😮
Thank it help me a lots !

Hi Martijn, Ofer,

thanks for the info, i was always cranking up VS to get the assembly types.

 PEN

Excelent guys, thanks, ofer that is great. I hadn’t seen the new addition of the @ for strings, that will simplify things a lot. Great tip on the getTypes, I had seen this in the help but hadn’t tried it yet. Time to dig some more into the other dotNet struct methods.

Page 2 / 4