Im using RadForm and i'm trying to add a second titlebar to my form but make it unable to close,maximize or minimize the current form, i only want the events to work such as close,maxinimize or minimize event, is there any way to achieve this?
RadTitleBar control is used in forms and provides functionality for dragging, minimizing, maximizing, and closing the form out of the box. This control is internally used by RadForm. Here you can find the events that triggers when interacting with the TitleBar: Properties and Events - RadTitleBar - Telerik UI for WinForms
It is strange that you are not able to close, maximize, or minimize the current form. I tested this on my end, and it is working properly. Please check the attached GIF file.
Am I missing something? Could you please provide the exact steps about how to reproduce the problem that you were facing. Thus, I could be able to assist you further.
I am looking forward to your reply.
Regards,
Nadya | Tech Support Engineer
Progress Telerik
@Nadya hi, you didn't quite get me, i have a RadTitleBar in my form, what i'm trying to achieve is prevent that titlebar from closing, maximizing or minimizing the current form after clicking any of the buttons, i only want it to execute the events such as Close,Maximize and Minimize events. so basically the second titlebar will execute only events without changing the form state
0
Nadya | Tech Support Engineer
Telerik team
answered on 30 Nov 2023, 01:02 PM
Hello, Daniel,
Please excuse me that I did not understand well your exact requirement.
It seems you want to prevent the RadTitleBar from closing, maximizing, or minimizing the current form. In this case, would it be suitable to disable these three buttons since having them enabled but not able to function properly may lead the users to confusion? If you want to disable them, you can set button's Enabled property to false.
You mentioned that you want to execute the button events. I am not sure what the exact behavior that you want to follow but in order to prevent the form from closing you can handle the FormClosing event and use e.Cancel=true in the event handler. For the minimize and maximize buttons the possible solution that I can suggest is to set the WindowState according to your needs. The following help article from StackOverFlow might be useful on this topic: c# - Disabling Minimize & Maximize On WinForm? - Stack Overflow
Please let me know if I can assist you further.
Regards,
Nadya | Tech Support Engineer
Progress Telerik