Visual Inheritance and User Defined Controls
Visual Inheritance and User Defined Controls
Visual Inheritance
and User-Defined
Controls
Visual Inheritance(1/12)
Visual
Visual Inheritance(2/12)
Visual Inheritance(3/12)
Visual Inheritance(4/12)
Visual Inheritance(5/12)
To visually
inherit from
VisualInheritanceBaseForm, create a new
Windows Forms app.
In this app, add a reference to the .dll you
just created.
Modify the line that defines the class:
public partial class VisualInheritanceTestForm :
VisualInheritanceBase.VisualInheritanceBaseForm
Visual Inheritance(6/12)
Design view, the new apps Form should
now display the controls inherited from the
base Form (Fig. 15.46).
Class VisualInheritanceTestForm
(Fig. 15.47) is a derived class of
VisualInheritanceBaseForm.
In
Visual Inheritance(7/12)
Visual Inheritance(8/12)
10
Visual Inheritance(9/12)
11
Visual Inheritance(10/12)
12
Visual Inheritance(11/12)
13
Visual Inheritance(12/12)
14
User-Defined Controls
The
15
User-Defined Controls
16
User-Defined Controls
17
18
19
Timer Control
20
User-Defined Controls
21
User-Defined Controls
15.50 shows the output of Clock,
which contains our ClockUserControl.
Figure
22
User-Defined Controls
23
24
Right click
On General
25
26
27
28
29
30
31
32
33
34
35
36
37
References
.NET
Documentation
Textbook, Chap 15
https://
msdn.microsoft.com/en-us/library/mt683786.asp
x
https://
msdn.microsoft.com/en-us/library/ms233813.asp
x
https://msdn.microsoft.com/enus/library/ee712572.aspx
38