Rhino 9.0.26272.12303 Eto.Forms.TabControl Bug in size TabPage Bitmap.
protected override void SolveInstance(IGH_DataAccess DA)
{
System.Drawing.Color bc = System.Drawing.Color.Black;
List<GH_ObjectWrapper> ctrls = new List<GH_ObjectWrapper>();
List tabs = new List();
string siz = "";
double index = 0;
DA.GetDataList(0, ctrls);
DA.GetDataList(1, tabs);
var ize = new Size();
if (DA.GetData(2, ref siz))
{
string[] xy = siz.Split(',');
bool xp = int.TryParse(xy[0], out int x);
bool yp = int.TryParse(xy[1], out int y);
if (xp && yp)
ize = new Size(x, y);
}
var col = Color.FromArgb(bc.R, bc.G, bc.B, bc.A);
if (DA.GetData(3, ref bc))
{
col = Color.FromArgb(bc.R, bc.G, bc.B, bc.A);
}
DA.GetData(4, ref index);
TabControl tabview = new TabControl { ID = Guid.NewGuid().ToString() };
for (int i=0; i<tabs.Count; i++)
{
TabPage tp = new TabPage() { Image = new Bitmap(tabs[i]), Size = ize, BackgroundColor = col };
try
{
if (ctrls[i].Value is Control ctrl)
{
DynamicLayout layout = new DynamicLayout();
layout.BackgroundColor = col;
layout.AddAutoSized(ctrl);
tp.Content = layout;
}
}
catch (Exception ex)
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, ex.Message);
}
tabview.Pages.Add(tp);
tabview.SelectedIndex = (int)index;
}
DA.SetData(0, new GH_ObjectWrapper(tabview));
}


