Posted 25 October 2022, 8:09 am EST - Updated 25 October 2022, 8:14 am EST
Hi C1,
it seems there was a change in the ways that the C1SplitButton dropdown items are handled in designer.
See attached sample - it contains a .NET 4.8 project and a .NET 6 project:
SplitButtonTest.zip
In .NET 4.8, there were member variables for each dropdown item, and in the designer, they had a name (which is the member variable name):
private C1.Win.C1Input.DropDownItem dropDownItem1;
I copied the sample form to the .NET 6 project and converted to .NET6:
private C1.Win.Input.SplitButtonItem dropDownItem1;
Now open the .NET6 form in designer and edit the items:
You will see that the items don’t have a property “Name”:
Now make any change to the form, e.g. change the location of the C1SplitButton. Save the form.
The SplitButtonItem variables were converted to local variables in “InitializeComponent”. And unfortunately, the class member variables are still there, but unused:
private void InitializeComponent()
{
C1.Win.Input.SplitButtonItem splitButtonItem1 = new C1.Win.Input.SplitButtonItem();
C1.Win.Input.SplitButtonItem splitButtonItem2 = new C1.Win.Input.SplitButtonItem();
this.c1SplitButton1 = new C1.Win.Input.C1SplitButton();
(to revert this, copy the code from “Form1_Original”)
Is this intended behavior? Or a bug? Or a limitation of the .NET6 WinForms designer?
If possible bring back the code that created member variables for the items. The current behavior might break existing forms by simply opening them in designer.
Best regards
Wolfgang