I have several composite UserControls, consisting of mostly labels and TextBoxes, and use the Control.DrawToBitmap to print the current UI. This works fine except for one composite UserControl. Its bitmap only contains a couple of controls within the U开发者_Go百科serControl. The Visible property of all controls is set to True. The documentation for DrawToBitmap states, "Controls inside containers are rendered in reverse order." I'm not entirely sure what this means but some controls are within panels, so I'm thinking this might have something to do with it. In any case, I've tried different orderings for the panels and the control within the panels, but nothing seems to help. Any ideas?
Figured it out. If e.g. two panels overlap but are not nested, then the controls in the panel that's behind the other panel will not be copied onto the bitmap. Changing the order (by bring to front) doesn't seem to have any effect.
精彩评论