March 2003
Intermediate to advanced
896 pages
32h 35m
English
Panel
This Control acts as a container for other
controls. The usual reason for creating a Panel is
to support a particular layout scheme. It also supports a
BorderStyle.
Note that introducing a Panel starts to play havoc
with the pseudotransparency supported by the framework (you will
often see the background painted into the panel with (0,0) in client
coordinates, rather than parent coordinates, which can cause trouble
with panels inside group boxes, for example.
When you are creating your own classes, you should derive from
UserControl rather than Panel.
While the only superficial difference at this time is that you can
set the BorderStyle of a Panel,
a UserControl also offers design-time support.
public class Panel : ScrollableControl { // Public Constructors public Panel(); // Public Instance Properties public BorderStyle BorderStyle{set; get; } public bool TabStop{set; get; } // overrides Control public override string Text{set; get; } // overrides Control // Protected Instance Properties protected override CreateParams CreateParams{get; } // overrides ScrollableControl protected override Size DefaultSize{get; } // overrides Control // Public Instance Methods public override string ToString(); // overrides System.ComponentModel.Component // Protected Instance Methods protected override void OnResize(EventArgs eventargs); // overrides Control // Events public event KeyEventHandler KeyDown; // overrides Control public event KeyPressEventHandler KeyPress; // overrides ...
Read now
Unlock full access