- 0
[C#] Is it possible to override the Form class?
Asked by
ProclaimDragon,
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By pmrd · Posted
There won't be any major changes from beta to release. -
By freedonX · Posted
Having been using Windows for 30 years and 3 Surface Pros in the meantime (4,6,9) and recently bought a 15" macbook air m4. The OS is indeed a big deal. Hardware wise the surface pro feels as nice as macbook air, but Windows...man it's it's own enemy now -
By +Edouard · Posted
2013 to 2017...wtf, is Steve on the wacky tabacky? Never heard of this or this Nathan guy in Australia. -
By Usama Jawad96 · Posted
Dell says it can't be blamed for Windows Night Light breaking on its Arm PCs by Usama Jawad Night Light is a very handy feature that is available by default in Windows 10 and Windows 11. Essentially, when you toggle it on, Windows reduces the emission of blue light from the display which in turn decreases the stress on eyes and can potentially aid in better sleep too. While this feature generally works quite well, this hasn't been the case so far on some Dell PCs. Now, Dell has acknowledged the issue in a recently published support document. As the situation currently stands, Night Light does not work on the secondary display on certain Windows Arm PCs when an external monitor is connected to them. This happens on the following PC models: Inspiron 14 5441 Inspiron 14 Plus 7441 Latitude 5455 Latitude 7455 XPS 13 9345 Now, Dell has confirmed that this is not due to any hardware or software issue on its side, it's just a limitation of the Qualcomm Oryon chipset. In essence, this is a problem that is outside the control of Dell. What this means is that while customers can utilize built-in and third-party tools to adjust the color profiles of their displays, Dell can't really get Windows Night Light to work as-is on external displays connected to any of the Arm PCs listed above. The company has emphasized that there are no plans to support Windows Night Light on its existing Arm PCs, and that customers will just have to make do with what they have. However, this feature will likely work as designed with the "next generation" of Arm computers, which will presumably leverage a chipset that is not held back by this limitation. Windows on Arm has enjoyed decent support from software developers in recent times; Microsoft will be hoping that it can keep the momentum going with its next Snapdragon PCs. -
By Ccl Ncc · Posted
that car they are showing run on very small areas and in controlled environments like no difficult intersection or construction areas while also having drivers in the car, while waymo has proven track record, one is working product which you can take today, the other is future promise with less service and more caveats (which has been delayed over a decade).
-
-
Recent Achievements
-
moojay67 earned a badge
Week One Done
-
lethalman earned a badge
Dedicated
-
B4dM1k3 earned a badge
Week One Done
-
adnan.hebibovic earned a badge
One Month Later
-
adnan.hebibovic earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
ProclaimDragon
Sorry, forgot to say in the topic title that this is C#.
Let me explain what I want to do...
We all know that with Windows Vista brought a new UI font, Segoe UI, but XP still uses Tahoma as UI font. This doesn't help us programmers. I've searched in Google and what I found was to use SystemFonts.MessageBoxFont as the Form's font because all other controls Font properties will inherit from it.
Now, I could do this.font = SystemFonts.MessageBoxFont; before InitializeComponent(); on every single form I use but that will have 2 problems:
1) I'll have to repeat this line for every form.
2) The designer will not be updated accordingly.
If I moved this.font = SystemFonts.MessageBoxFont; into InitializeComponent() itself, then, the designer would be updated but I still would need to do it manually for every form.
My first solution:
Create a class (MyForm, for instance) that inherits from Form and change the properties I need in it's constructor. Then, every form I use in my application must be inherited from MyForm instead of Form. This is simpler than to place the line above in every InitializeComponent(), although, I still have to manually change every from to inherit from MyForm instead of Form.
To sum this up... I'm looking for a way (if possible) to change some default properties of Form without creating a new class that inherits from it, which allows me to make all the needed properties changes in one place and all my forms will still inherit from Form (as they are by default).
Is this possible?
Edited by NazgulledLink to comment
https://www.neowin.net/forum/topic/638927-c-is-it-possible-to-override-the-form-class/Share on other sites
15 answers to this question
Recommended Posts