View Full Version : Dotnet VisualBasic Form Reader
04-21-2008, 08:08 PM
Hi guys, today I've started another not yet so simple script that was in my mind awhile ago, since Max doesnt have a visual editor for dotnet controls, it would be cool to create them using VB Express or something (but since I use VB Express... :P) and them have that form imported into Max, that's what I did, in a simple way, it only works with some controls at the moment and not all properties work, but that's a wip and with time it can be refined. Anyway, for simpler stuff, I guess this is good start and it allows to make nice UI's without having the headache of System.Points bla bla :)
The controls are added to an array, the control names are the same defined in VB so it's easy to use them. Hope you like it!
PS- I've attached a .Designer.vb file just to serve as an example, if you want to create your own, simply save a form in VB and then redirect this line in the script to your own file:
ffile=openFile "frm_main.Designer.vb" mode:"r"
04-23-2008, 06:07 PM
Hi guys, today I added more support for the simpler controls (I think almost everything is working, regarding text boxes, buttons and so on). I've added the possibility to create the items in a listbox/combobox/etc in VB and have them imported perfectly into Max :D I also added support for Tabs (although someting is weird with the interface color, but it seems to be a bug from the control), support for WebBrowser control, checkboxes, listed checkboxes, richttextbox :P I admit I'm having fun creating the UI's in VB and having them nicely recreated in Max without any trouble, hope you have fun also :) Cya!
04-24-2008, 09:29 AM
Well done and thank you. I will be sure to give this a try since most of the time i have VS and max open side by side! :beer:
04-24-2008, 09:46 AM
Thanks LoneRobot, I hope it fits your needs, I've done some changing last night, I've defined a struct and now it's easier to include that file in another script, I'll upload it here. Just include the file in your script and then load your form this way:
I've also created a function to return a control, just do:
Here's an example I've made (actually I just ported a script I already did, to this form reading method, it saved me lot of code lines! who would have guessed! hehe):
fn btn_ok_Click =
if myobj.selecteditem==undefined then return
for i=0 to myobj.Items.Count-1 do
if issel then
for i in arr_nodes do unhide i
fn frm_main_Load =
for i=0 to LayerManager.count-1 do
myobj.Items.Insert i (dotnetobject "System.String" layer.name)
dotnet.addEventHandler myobj "Click" btn_ok_Click
dotnet.addEventHandler myform "Load" frm_main_Load
04-24-2008, 06:52 PM
Hi! More updates on this one! I've solved a problem regarding the DotNet Form that was annoying to say the least, also spend the afternoon adding support for the DataGridView and almost all it's column modes, except for the Image one, Combo, Button and Check are fully functional, you can even save items in VB in the Combo one as they will be loaded into Max :D This one was for Koichi! Hehe
The other control I've added was the MenuStrip and corresponding ToolstripItems, so you can create all the menus in VB :D Oh, Panels are now supported, docking controls also works.
I've included a .Designer.vb file with almost all controls supported. Hope you guys like it!
04-24-2008, 06:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.