Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: KryptonForm Enhancement - A option to disable/enable the close button #819

Closed
PWagner1 opened this issue Oct 6, 2022 · 8 comments
Labels
completed This issue has been completed. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested.
Milestone

Comments

@PWagner1
Copy link
Contributor

PWagner1 commented Oct 6, 2022

There are already options to do this with the maximise & minimise, but why not the close button?

@PWagner1 PWagner1 added enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. labels Oct 6, 2022
@PWagner1 PWagner1 changed the title [Feature Request]: A option to disable/enable the close button [Feature Request]: KryptonForm Enhancement - A option to disable/enable the close button Oct 10, 2022
@Smurf-IV
Copy link
Member

@Wagnerp Do you mean the equivalent of these ?
image

i.e. to make them visible or not,
Or, is this a runtime setting you have found ?

@PWagner1
Copy link
Contributor Author

@Wagnerp Do you mean the equivalent of these ? image

i.e. to make them visible or not, Or, is this a runtime setting you have found ?

@Smurf-IV Yes, currently the only similar way to do it is to 'hide' the control box. But that then hides the other two controls.

@Smurf-IV
Copy link
Member

Ok, I have found the code:
image

And in the Max / min button classes this sort of thing:
image

So to make it "Work" it will need to be both a designer AND a programmatic thing?
i.e.

  1. Make is Visible / invisible like the max . min designer
  2. AND make it programmatic based on a "User" condition value as well ?

@PWagner1
Copy link
Contributor Author

Something similar to this https://www.codeproject.com/Articles/93959/WinForm-Extended

CloseButton:

I added a new property called CloseButton. By setting this property to false, the window close button will be grayed out and > the user will no longer be able to close the form. The form is still closable if: The parent form gets closed, the task manager > closes the application, windows shuts down or there is a call to Application.Exit()

@PWagner1
Copy link
Contributor Author

Ok, I have found the code: image

And in the Max / min button classes this sort of thing: image

So to make it "Work" it will need to be both a designer AND a programmatic thing? i.e.

  1. Make is Visible / invisible like the max . min designer
  2. AND make it programmatic based on a "User" condition value as well ?

Colour changes may need to be done in the 2010/13/365 themes as well. I think I've added a '// Note:' prompt in them

@Smurf-IV Smurf-IV self-assigned this Oct 30, 2022
@Smurf-IV Smurf-IV added the under investigation This bug/issue is currently under investigation. label Oct 30, 2022
@Smurf-IV
Copy link
Member

There is something in the "Ribbon Control" that ignores the settings !!
Anyway, Does this need to disable "Alt+F4" if the Close is Disabled / inivisible ?

@PWagner1
Copy link
Contributor Author

Does this need to disable "Alt+F4" if the Close is Disabled / inivisible ?

No, though it could be added sometime in the future...

@Smurf-IV
Copy link
Member

Smurf-IV commented Oct 30, 2022

Design time visibility (Similar to the Max / Min):
image

Programmatic Enabled (Disable) of the button:
image

Caveat with the Disabling of the button, is that the Code needs to handle the "Alt+F4" action themselves.

Smurf-IV added a commit that referenced this issue Oct 30, 2022
- Add `PInvoke` things for menu control

#819
@Smurf-IV Smurf-IV removed their assignment Oct 30, 2022
@Smurf-IV Smurf-IV added completed This issue has been completed. and removed under investigation This bug/issue is currently under investigation. labels Oct 30, 2022
Smurf-IV added a commit that referenced this issue Oct 30, 2022
@PWagner1 PWagner1 added this to the Version 8 milestone Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This issue has been completed. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested.
Projects
None yet
Development

No branches or pull requests

2 participants