I have created a simple test form with FormBorderStyle = FixedToolWindow by default and added a piece of code to the form DoubleClick event that will switch between FixedToolWindow and SizableToolWindow.
Switching the FormBorderStyle between these two seems to produce a weird effect that's causing a lot of issues on my application. The problem is that the window seems to change size and I can't have that. I just want to change the border, I need the form size to remain the same.
How can I fix this behavior? And by "fix", I mean, prevent this from happening if possible. I want to be able to specify my form size and to remain like that, no matter the type of border style.
Also, a solution by subclassing the Form class would be the perfect solution for me in case anyone as any ideas to solve this problem with such a method.
I am linking it for anyone that runs Windows 11 that isn't specifically you that is following our conversation, since it is likely that others have the problem. As you can see, it isn't the slightest bit pointless at all.
Firefox 139.0.4 by Razvan Serea
Firefox is a fast, full-featured Web browser. It offers great security, privacy, and protection against viruses, spyware, malware, and it can also easily block pop-up windows. The key features that have made Firefox so popular are the simple and effective UI, browser speed and strong security capabilities.
Firefox has complete features for browsing the Internet. It is very reliable and flexible due to its implemented security features, along with customization options. Firefox includes pop-up blocking, tab-browsing, integrated Google search, simplified privacy controls, a streamlined browser window that shows you more of the page than any other browser and a number of additional features that work with you to help you get the most out of your time online.
Download: Firefox 64-bit | Firefox 32-bit | ARM64 | ~60.0 MB (Freeware)
Download: Firefox 139.0.4 for Linux | 64-bit | ~90.0 MB
Download: Firefox for MacOS | 127.0 MB
View: Firefox Home Page | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
Question
ProclaimDragon
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and added a piece of code to the form DoubleClick event that will switch between FixedToolWindow and SizableToolWindow.
Switching the FormBorderStyle between these two seems to produce a weird effect that's causing a lot of issues on my application. The problem is that the window seems to change size and I can't have that. I just want to change the border, I need the form size to remain the same.
For instance, here's the event code:
And to debug I use this:
private void Settings_SizeChanged(object sender, System.EventArgs e) { System.Diagnostics.Debug.WriteLine(this.Size); }
And here's the output when I double click:
How can I fix this behavior? And by "fix", I mean, prevent this from happening if possible. I want to be able to specify my form size and to remain like that, no matter the type of border style.
Also, a solution by subclassing the Form class would be the perfect solution for me in case anyone as any ideas to solve this problem with such a method.
Link to comment
https://www.neowin.net/forum/topic/771472-strange-behavior-in-formborderstyle-between-fixed-and-sizable/Share on other sites
7 answers to this question
Recommended Posts