forked from ArthurHub/HTML-Renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.HtmlPanel.htm
More file actions
142 lines (142 loc) · 5.93 KB
/
Copy path10.HtmlPanel.htm
File metadata and controls
142 lines (142 loc) · 5.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<html>
<head>
<title>HtmlPanel</title>
<link rel="Stylesheet" href="StyleSheet" />
</head>
<body>
<h1>
HtmlPanel Control
</h1>
<code>HtmlRenderer.HtmlPanel</code>
<div>
Extends <code>System.Windows.Forms.ScrollableControl</code>
</div>
<blockquote>
<p>
You can use it just as an HTML container control, just place the panel on a form
and feed the <code>Text</code> property with HTML code.<br />
If <span style="color: blue">AutoScroll</span> is true and the layout of the html
resulted in its content beyond the client bounds of the panel it will show scrollbars
(horizontal/verticle) allowing to scroll the content.<br />
If <span style="color: blue">AutoScroll</span> is false html content outside the
client bounds will be cliped.<br />
The control will handle mouse and keyboard events on it to support html text selection,
copy-paste and mouse clicks.<br />
<br />
Try the <a href="ShowSampleForm">Sample Form</a> to play with html panel control.
</p>
<h2>
Properties
</h2>
<ul>
<li>
<img src="PropertyIcon" />
<b>IsSelectionEnabled</b> - <span class="comment2">Is content selection is enabled for
the rendered html (default - true).</span> </li>
<li>
<img src="PropertyIcon" />
<b>IsContextMenuEnabled</b> - <span class="comment2">Is the build-in context menu enabled
and will be shown on mouse right click (default - true).</span> </li>
<li>
<img src="PropertyIcon" />
<b>BaseStylesheet</b> - <span class="comment2">Set base stylesheet to be used by html
rendered in the panel.</span> </li>
<li>
<img src="PropertyIcon" />
<b>AutoScroll</b> - <span class="comment2">Gives the panel scroll bars when content
needs it.</span> </li>
<li>
<img src="PropertyIcon" />
<b>Text</b> - <span class="comment2">Gets or sets the HTML source for rendering.</span>
</li>
</ul>
<h2>
Methods
</h2>
<ul>
<li>
<img src="MethodIcon" />
<b>GetHtml()</b> - <span class="comment2">Get html from the current DOM tree with inline
style.</span> </li>
</ul>
<h2>
Events
</h2>
<ul>
<li>
<img src="EventIcon" />
<b>LinkClicked</b> - <span class="comment2">Raised when the user clicks on a link in
the html, Allows canceling the execution of the link.</span> </li>
<li>
<img src="EventIcon" />
<b>RenderError</b> - <span class="comment2">Raised when an error occured during html
rendering.</span> </li>
<li>
<img src="EventIcon" />
<b>StylesheetLoad</b> - <span class="comment2">Raised when aa stylesheet is about to
be loaded by file path or URI by link element. This event allows to provide the
stylesheet manually or provide new source (file or uri) to load from.</span>
</li>
<li>
<img src="EventIcon" />
<b>ImageLoad</b> - <span class="comment2">Raised when an image is about to be loaded
by file path or URI. This event allows to provide the image manually, if not handled
the image will be loaded from file or download from URI.</span> </li>
</ul>
<h1>
Remarks
</h1>
<p>
<h3>
Differences between HtmlPanel and HtmlLabel
</h3>
The major differential to use HtmlPanel or HtmlLabel is size and scrollbars.<br />
If the size of the control depends on the html content the HtmlLabel should be used.<br />
If the size is set by some kind of layout then HtmlPanel is more suitable, also
shows scrollbars if the html contents is larger than the control client rectangle.<br />
<ul>
<li>HtmlPanel has scrollbars support</li>
<li>HtmlLabel can be <i>autosized</i></li>
<li>HtmlLabel can have transparent background</li>
</ul>
</p>
<p>
<h3>
AutoScroll
</h3>
Allows showing scrollbars if html content is placed outside the visible boundaries
of the panel.
</p>
<p>
<h3>
LinkClicked event
</h3>
Raised when the user clicks on a link in the html.<br />
Allows canceling the execution of the link.
</p>
<p>
<h3>
StylesheetLoad event
</h3>
Raised when aa stylesheet is about to be loaded by file path or URI by link element.<br />
This event allows to provide the stylesheet manually or provide new source (file
or uri) to load from.<br />
If no alternative data is provided the original source will be used.<br />
</p>
<p>
<h3>
ImageLoad event
</h3>
Raised when an image is about to be loaded by file path or URI.<br />
This event allows to provide the image manually, if not handled the image will be
loaded from file or download from URI.
</p>
<p>
<h3>
RenderError event
</h3>
Raised when an error occured during html rendering.<br />
</p>
</blockquote>
</body>
</html>