there I thought the days of CreateParams were over ... observation (tip ?)
-
using Framework 4.8, WinForms (classic). I'm doing some complex run-time stuff with a TableLayoutPanel in a UserControl ... adding, replacing Controls, resizing columns, changing ColumnSpans ... even though the UserControl is double buffered, as well as its hosting Form (site) ... the usual bracketing in Suspend/Restore-Layout blocks does not prevent cascades of spastic stuttering. But, one little dose of good old CreateParams
// insert at Class scope in your UserControl or sub-classed WinForm container
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle = cp.ExStyle | 0x2000000;
return cp;
}
}I thought that had gone extinct with other VB-heritage dinosaurs like 'DoEvents.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
-
using Framework 4.8, WinForms (classic). I'm doing some complex run-time stuff with a TableLayoutPanel in a UserControl ... adding, replacing Controls, resizing columns, changing ColumnSpans ... even though the UserControl is double buffered, as well as its hosting Form (site) ... the usual bracketing in Suspend/Restore-Layout blocks does not prevent cascades of spastic stuttering. But, one little dose of good old CreateParams
// insert at Class scope in your UserControl or sub-classed WinForm container
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle = cp.ExStyle | 0x2000000;
return cp;
}
}I thought that had gone extinct with other VB-heritage dinosaurs like 'DoEvents.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
Yeah, I've had to use it occasionally as well: Disable the Close box on a form[^] But ... at least MS provided a nice, easy way to do something they didn't think you'd ever want to! If they hadn't ... it would have been a real PITA. :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Yeah, I've had to use it occasionally as well: Disable the Close box on a form[^] But ... at least MS provided a nice, easy way to do something they didn't think you'd ever want to! If they hadn't ... it would have been a real PITA. :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
OriginalGriff wrote:
MS provided a nice, easy way to do something they didn't think you'd ever want to!
As opposed to the method they've provided in Weleven for changing your default web browser.
The difficult we do right away... ...the impossible takes slightly longer.
-
Yeah, I've had to use it occasionally as well: Disable the Close box on a form[^] But ... at least MS provided a nice, easy way to do something they didn't think you'd ever want to! If they hadn't ... it would have been a real PITA. :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Hi, I don't remember what the state/quirks of WinForms was in 2012, when you wrote that tip, but, it is possible to toggle the visibility of the ControlBox at run-time by setting its boolean value. Of course, yes, hide the ControlBox, and the max/min buttons and the icon/menu, vanish. However, I'd find it quite strange to have those control widgets disappearing, reappearing :)
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch