diff options
author | abrevet-dev <57099550+abrevet-dev@users.noreply.github.com> | 2019-11-28 01:38:04 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-11-28 01:38:04 +0300 |
commit | f135312b4467ae6b602747af2273a3f42fe61c45 (patch) | |
tree | 8f5baa62386011ae27e64e3fb7bfd7fc4cf09a6a /mcs/class/System.Windows.Forms | |
parent | abc75476d719b9d55cda60a6400be3fc92bca11a (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.cs | 10 |
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)); + } + + } } |