Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorАлександр Хухлаев <sancheolz@gmail.com>2019-09-18 00:26:05 +0300
committerKatelyn Gadd <kg@luminance.org>2019-09-18 00:26:05 +0300
commitf91b64d9ad7b2be3d2012a479f31a30e5602970c (patch)
tree2693ea8214d9e1769924d57a4af6553fc22d9a1c /mcs/class/System.Windows.Forms
parente1f5738371c199810e1ee04fb7238cd0746e2600 (diff)
[WinForms] fix #16626 ControlBox property didn`t hide Close button and icon when set to false (#16627)
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs2
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs6
2 files changed, 7 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
index 62a5c9286af..d5e6d9bc8e3 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
@@ -433,6 +433,8 @@ namespace System.Windows.Forms {
get {
if (!Form.ShowIcon)
return false;
+ if (!Form.ControlBox)
+ return false;
if (!HasBorders)
return false;
if (IsMinimized)
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
index f2415f506a6..bd6eda78121 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
@@ -6255,7 +6255,11 @@ namespace System.Windows.Forms
}
// Respect MinimizeBox/MaximizeBox
- if (form.MinimizeBox == false && form.MaximizeBox == false) {
+ if (form.ControlBox == false) {
+ buttons.MinimizeButton.Visible = false;
+ buttons.MaximizeButton.Visible = false;
+ buttons.CloseButton.Visible = false;
+ } else if (form.MinimizeBox == false && form.MaximizeBox == false) {
buttons.MinimizeButton.Visible = false;
buttons.MaximizeButton.Visible = false;
} else if (form.MinimizeBox == false)