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
403 stars 61 forks source link

[Feature Request]: Toggle switch/button #1116

Open PWagner1 opened 1 year ago

PWagner1 commented 1 year ago

It would be nice to have a toggle switch as part of the toolkit

download

Smurf-IV commented 1 year ago

I thought this was already in the extended kit ?? If not, then that is where it should be ? Or has winforms now got it in for .net8 ?

PWagner1 commented 1 year ago

I thought this was already in the extended kit ??

It is, but I wondered if it could be a variant of the KCheckButton? The toolkit was originally designed when the Windows OS did not have a toggle switch controls. These were introduced with Windows 8 and are still being used.

Smurf-IV commented 1 year ago

The toolkit was originally designed when the Windows OS did not have a toggle switch controls. These were introduced with Windows 8 and are still being used.

I understand that lot's of controls are added as the OS moves on into different recommended app styles (UWP etc) But I believe the Standard kit is to replace the the Controls currently in the Visual Studio Winform Toolkit. And Extended "mainly" to bring in the newer controls from UWP etc. And Also the extended to enhance / extend the standard kit.

What would you like to change the philosophy to be starting with V8.1 onwards ? If its documented then Devs will know what to expect.

Smurf-IV commented 1 year ago

Also, As per #1062; When VS has added Other Controls to VS, then they can also be moved / implemented in the standard kit. A bit like what has been done to retrofit the new button in MessageBox [Cancel / retry / continue] down to the other frameworks.

PWagner1 commented 1 year ago

Also, As per #1062; When VS has added Other Controls to VS, then they can also be moved / implemented in the standard kit. A bit like what has been done to retrofit the new button in MessageBox [Cancel / retry / continue] down to the other frameworks.

Might be worth keeping an eye out

Smurf-IV commented 10 months ago

OK, Will also need

PWagner1 commented 1 week ago

@Smurf-IV & @giduac

Is it possible to create it based off a KCheckBox?

Smurf-IV commented 1 week ago

@Smurf-IV & @giduac

Is it possible to create it based off a KCheckBox?

Yes, as the actions needed by the "in-designer" and events would be the same. Drawing and Palette designer additions would need to be done (Unless colours could be borrowed from button highlights etc)

PWagner1 commented 1 week ago

@Smurf-IV & @giduac Is it possible to create it based off a KCheckBox?

Yes, as the actions needed by the "in-designer" and events would be the same. Drawing and Palette designer additions would need to be done (Unless colours could be borrowed from button highlights etc)

Also, we would need to facilitate labels for 'On/Off'

giduac commented 1 week ago

@PWagner1 & @Smurf-IV

Have a look at the Winform checkbox using the flatstyle properties. You can achieve as similar effect and use images for the checked (on/off) state.

That might be done in KCB with the underlying winforms checkbox.

That could be a sperate KControl or integrated into the KCBox...

When doing that you need also set the Appearance property to button

giduac commented 1 week ago

Or use the KCheckbutton with images...

Smurf-IV commented 1 week ago

Or use the KCheckbutton with images...

But then you would not get the "Slide" action when toggling ;-(

giduac commented 1 week ago

@Smurf-IV & @PWagner1 Depends... If you animate the toggle from the point where the check state changes and displaying several images in a row until the on/of state is reached....

If you added some kind of the above to a kcheckbutton.... Or use that as a base...

Another thing is the scaling of the imagery when the user resizes the button. If possible it should be a vector image