Notifications
Clear all

[Closed] SplitContainer in a rollout – does it work??

does anybody here tried to put .NET SplitContainer in a rollout? did it work?
I can put the SplitContainer in a rollout, but when I try to resize the panels by dragging the dividing line in the middle I get an error:
“System.NullReferenceException: Object reference not set to an instance of an object.”

here’s my code:


rollout ro_TEST "TEST"
(
	dotNetControl conta "System.Windows.Forms.SplitContainer" height:300
	
	fn openDialog = (
		createDialog ro_TEST width:300 height:300 
		conta.Dock = (dotnetclass "System.Windows.Forms.DockStyle").Fill
		conta.Panel1.BackColor = (dotnetclass "System.Drawing.Color").Aquamarine
	 )
   
) 

ro_TEST.openDialog()

if someone here knows how to get it work please help!

2 Replies

SplitContainer was designed to Split .NET controls (not MAX Rollout control!)… Create any .NET control and add SplitContainer to this control (in my code I used Label)

How it has to be:


try(destroydialog ro_TEST) catch()
rollout ro_TEST "TEST"
(
dotNetControl forma "System.Windows.Forms.Label" pos:[8,8] width:180 height:180
 
fn initFormButton =
(
conta = dotNetObject "System.Windows.Forms.SplitContainer"
conta.Dock = (dotnetclass "System.Windows.Forms.DockStyle").Fill
conta.Panel1.BackColor = (dotnetclass "System.Drawing.Color").Yellow
 
forma.controls.add conta
)
 
on ro_TEST open do 
(
initFormButton()
)
 
) 
createDialog ro_TEST width:200 height:200

Thank you very much for this bypass! it didn’t occur to me that this is the problem