Notifications
Clear all

[Closed] Converting C# dotnet to MXS dotnet

Hi

Im trying to convert the following code from c# :

tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F))

So I have made something like this:

sizeType = dotNetClass “System.Windows.Forms.SizeType”
columnStyle = dotNetObject “System.Windows.Forms.ColumnStyle”
columnStyle.sizeType = sizeType.Absolute
tableLayoutPanel.ColumnStyles.Add columnStyle

This works fine but I dont know how to set value to the sizeType.Absolute
In c# its set to 35 of type float

3 Replies
columnStyle = dotNetObject "System.Windows.Forms.ColumnStyle" ((dotNetClass "System.Windows.Forms.SizeType").absolute) 35.0

but when I check it isn’t Aboslute but AutoSize instead

columnStyle.SizeType.value__ == columnStyle.SizeType.Absolute – returns False

1 Reply
(@aaandres)
Joined: 1 year ago

Posts: 0

If I’m not wrong, equality should be:

columnStyle.SizeType.value__ == columnStyle.SizeType.Absolute.value__ – returns True

Thus it’s seems OK.

Thanks it works, I think my mistake was sending 35 as argument to .SizeType and not to .ColumnStyle