MrNobody,
You have a custom control derived from Panel. You add another Panel
(not your custom control) in the constructor, and paint in that. Something
like this:
public class MyPanel : Panel
{
// The internal panel that is drawn on.
private Panel drawingPanel;
public Panel()
{
// Set the auto scroll property to true.
this.AutoScroll = true;
// Create the panel.
drawingPanel = new Panel();
// Add it.
this.Controls.Add(drawingPanel);
// Set the location of the panel to the origin, so that it looks
like painting on the panel takes place on the
// control.
drawingPanel.Location = new Point(0, 0);
// Set the size of the inner panel here.
// You can also set the size anywhere else that you wish. When you
adjust the size of the
// drawing panel, this control should show the scrollbars if the
size of the inner panel exceeds the size of
// this control. You might also have to set the Dock property of
the drawingPanel to the top left corner.
drawingPanel.Size = ...
}
private void DrawingPanelPaintEventHandler(object sender,
PaintEventArgs)
{
// Handle the painting here.
}
}
"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
I must be misunderstanding something because I cannot seem to get the
behavior you describe doing the steps you listed. Create a custom control
which does it's own drawing but in it's consutructor create another
instance
of itself? Would you be able to show me what you mean via pseudo code or
just
regular code?