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:
authorabrevet-dev <57099550+abrevet-dev@users.noreply.github.com>2019-11-28 01:38:04 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-11-28 01:38:04 +0300
commitf135312b4467ae6b602747af2273a3f42fe61c45 (patch)
tree8f5baa62386011ae27e64e3fb7bfd7fc4cf09a6a /mcs/class/System.Windows.Forms
parentabc75476d719b9d55cda60a6400be3fc92bca11a (diff)
[WinForms] DrawToBitmap() did not draw children controls (#17676)
Fixes #13777
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
index d9fff17a896..c92b7a7aae3 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
@@ -2589,6 +2589,16 @@ namespace System.Windows.Forms
if (!pea.Handled)
OnPaint (pea);
}
+
+ // Call DrawToBitmap for all children of the control
+ for (int i=0; i < child_controls.Count; i++) {
+ Rectangle childRect = child_controls[i].ClientRectangle;
+ Bitmap childBitmap = new Bitmap (childRect.Width, childRect.Height);
+ child_controls[i].DrawToBitmap (childBitmap, childRect);
+ g.DrawImage (childBitmap, new Rectangle (child_controls[i].Location, child_controls[i].Size));
+ }
+
+
}
}