Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 6 - 8
BSD 3-Clause "New" or "Revised" License
388 stars 57 forks source link

[Bug]: Issue with KryptonSplitContiner when **Only** targeting .net 7 #955

Closed Bonio55 closed 2 months ago

Bonio55 commented 1 year ago

Describe the bug When attempting to use the KryptonSplitContainer on a winform project targeting .net 7 the 2 panels do not appear to be created properly and on attempt to add a control to the KryptonSplitContainer an error is recieved

Failed to create component 'KryptonTextBox'. The error message follows: 'Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: ReadOnly controls collection at 'Microsoft.DotNet.DesignTools.Client.DesignToolsClient. d__49`1.MoveNext()

To Reproduce Steps to reproduce the behavior:

  1. Create new winform project targeting .net 7
  2. Create New Form
  3. Add new KryptonSplitContainer Control
  4. Attempt to add any control i.e. TextBox to one of the panel (or where a panel should be located) of the splitcontainer.

Note

This procedure has been repeated step for step but on a second project targeting .net framework 4.7.2 and the issue is not pressent and the splitcontainer works as expected. only when targeting .net 7 in stead does this issue occur.

Expected behavior New Item should appear in the splitcontainer.

Screenshots Screenshot one shows the Krypton split container after being added to the form (the panels of which do not appear to be rendered as expected as suspect this is where the problem my originate and possible the internal panels being created may at fault? )

Screenshot two is the error message received.

Desktop (please complete the following information):

Additional context Add any other context about the problem here. SplitContainerError_1 SplitContainerError_2

PWagner1 commented 1 year ago

@Smurf-IV Seems to be another designer issue?

Bonio55 commented 1 year ago

Hi, I dont know if this needs to be raised as a seperate report but I have also just come across this same issue with a KryptonGroupBox when tryingto add a control in at designtime.

Im my limited experience with .net (oposed to framework) as a process of attempting to migrate my existing project from framework 4.7.2 to .net 7 - I dont know if this is of any help or is just me not understanding how the controls are programmed but I re-run my test project used to demo the above issue and compiled the Krypton Suite from source and attempted to debug to see if could narrow down the issue at all. I did observe that tho the parent control (KryptonSplitContiner and KryptonGroupBox) show the internal 'Panel' controlls as not being in design mode when the parent controll is. Sorry if this is a wild goose chase but thought would mention incase this information helps at all.

Kind Regards Shaun

PWagner1 commented 1 year ago

Hi @Bonio55

Unfortunately, MS seems to have broken a lot of WinForms designer stuff since moving to .NET. We're waiting for a specific SDK which should fix these issues.

Bonio55 commented 1 year ago

Thats no problem i think i may revert back to framework for the time being and wait on the migration but its not a lost cause and now using the nuget packages as was previously on a couple year old source code set but in mean time if you need me to look into anything with regards to above / my findings let me know and I will shelf a copy of the project files incase.

Also a big thanks to you all for the Suite itself and the ongoing development you all put in :-)

Smurf-IV commented 9 months ago

revert back to framework for the time being

@Bonio55 You only need to have the net48 in the sdk style project to allow the designer to work (as expected) And still have your projects building out to the latest net core (V8 now) so that you get the speed benefits (etc)

giduac commented 2 months ago

Hi @Wagnerp,

This is a standard OOP Designer case, and can be closed. Not much we can do about this currently.

Ty.