Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compact Framework 3.5 Set Form parent

In .net Compact Framework 2.0, you could add a form to another forms control array basically parenting the other form.

i.e._mainForm.Controls.Add(form);

This is not allowed in .net cf 3.5 and results in an exception:

System.ArgumentException: Value does not fall within the expected range. at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar) at System.Windows.Forms.Control._SetParent(Control ctlParent) at System.Windows.Forms.Control.set_Parent(Control value)

Is there a workaround or alternative for this? I need to be able to parent a form inside a panel on another form.

like image 654
JoelHess Avatar asked Mar 04 '26 21:03

JoelHess


1 Answers

I think this contains answer to your question: http://207.46.16.248/en-us/netframework/bb986636.aspx

especially this part:

System.Windows.Forms.Form.Parent

Description Forms can no longer be parented.

Previous Behavior
In .NET Compact Framework 1.0, forms could be parented to any other control that supported child controls. In .NET Compact Framework 2.0, forms could be parented to any other form.

New Behavior

In the .NET Compact Framework version 3.5, forms cannot be parented.

like image 54
grapkulec Avatar answered Mar 06 '26 19:03

grapkulec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!