-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
PaintEventArgs.xml
411 lines (376 loc) · 28.5 KB
/
PaintEventArgs.xml
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<Type Name="PaintEventArgs" FullName="System.Windows.Forms.PaintEventArgs">
<TypeSignature Language="C#" Value="public class PaintEventArgs : EventArgs, IDisposable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit PaintEventArgs extends System.EventArgs implements class System.IDisposable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.PaintEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class PaintEventArgs
Inherits EventArgs
Implements IDisposable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeSignature Language="F#" Value="type PaintEventArgs = class
 inherit EventArgs
 interface IDisposable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeSignature Language="C++ CLI" Value="public ref class PaintEventArgs : EventArgs, IDisposable" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;windowsdesktop-3.0;windowsdesktop-3.1" />
<TypeSignature Language="C#" Value="public class PaintEventArgs : EventArgs, IDisposable, System.Drawing.IDeviceContext" FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit PaintEventArgs extends System.EventArgs implements class System.Drawing.IDeviceContext, class System.IDisposable" FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<TypeSignature Language="VB.NET" Value="Public Class PaintEventArgs
Inherits EventArgs
Implements IDeviceContext, IDisposable" FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<TypeSignature Language="F#" Value="type PaintEventArgs = class
 inherit EventArgs
 interface IDisposable
 interface IDeviceContext" FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<TypeSignature Language="C++ CLI" Value="public ref class PaintEventArgs : EventArgs, IDisposable, System::Drawing::IDeviceContext" FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
<Interface FrameworkAlternate="windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0">
<InterfaceName>System.Drawing.IDeviceContext</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides data for the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Control.Paint> event occurs when a control is redrawn. A <xref:System.Windows.Forms.PaintEventArgs> specifies the <xref:System.Windows.Forms.PaintEventArgs.Graphics%2A> to use to paint the control and the <xref:System.Windows.Forms.PaintEventArgs.ClipRectangle%2A> in which to paint.
For information about the event model, see [Handling and Raising Events](/dotnet/standard/events/).
## Examples
The following example demonstrates handling the <xref:System.Windows.Forms.Control.Paint> event and using the <xref:System.Windows.Forms.PaintEventArgs> class to draw rectangles on the form. The <xref:System.Windows.Forms.Control.MouseDown> and <xref:System.Windows.Forms.Control.MouseUp> events are handled to determine the size of the rectangle. The example also demonstrates the <xref:System.Windows.Forms.Control.Invalidate%2A> method to invalidate the area of the rectangle, causing it to be redrawn.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Demontrates Form Paint Event/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PaintEventArgs/Overview/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Demontrates Form Paint Event/VB/form1.vb" id="Snippet1":::
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Paint/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnPaint/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Graphics" />
<altmember cref="T:System.Drawing.Rectangle" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public PaintEventArgs (System.Drawing.Graphics graphics, System.Drawing.Rectangle clipRect);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Drawing.Graphics graphics, valuetype System.Drawing.Rectangle clipRect) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.#ctor(System.Drawing.Graphics,System.Drawing.Rectangle)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (graphics As Graphics, clipRect As Rectangle)" />
<MemberSignature Language="F#" Value="new System.Windows.Forms.PaintEventArgs : System.Drawing.Graphics * System.Drawing.Rectangle -> System.Windows.Forms.PaintEventArgs" Usage="new System.Windows.Forms.PaintEventArgs (graphics, clipRect)" />
<MemberSignature Language="C++ CLI" Value="public:
 PaintEventArgs(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipRect);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="graphics" Type="System.Drawing.Graphics" />
<Parameter Name="clipRect" Type="System.Drawing.Rectangle" />
</Parameters>
<Docs>
<param name="graphics">The <see cref="T:System.Drawing.Graphics" /> used to paint the item.</param>
<param name="clipRect">The <see cref="T:System.Drawing.Rectangle" /> that represents the rectangle in which to paint.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.PaintEventArgs" /> class with the specified graphics and clipping rectangle.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Drawing.Graphics> identified by the `graphics` parameter is disposed when the <xref:System.Windows.Forms.PaintEventArgs> is disposed.
## Examples
The following code examples draws lines and text on a <xref:System.Windows.Forms.PictureBox> control.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Paint/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnPaint/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Rectangle" />
<altmember cref="T:System.Drawing.Graphics" />
</Docs>
</Member>
<Member MemberName="ClipRectangle">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle ClipRectangle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Rectangle ClipRectangle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.PaintEventArgs.ClipRectangle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ClipRectangle As Rectangle" />
<MemberSignature Language="F#" Value="member this.ClipRectangle : System.Drawing.Rectangle" Usage="System.Windows.Forms.PaintEventArgs.ClipRectangle" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Rectangle ClipRectangle { System::Drawing::Rectangle get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the rectangle in which to paint.</summary>
<value>The <see cref="T:System.Drawing.Rectangle" /> in which to paint.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Control.Paint?displayProperty=nameWithType> event. This report helps you to learn when the event occurs and can assist you in debugging.
To run the example code, paste it into a project that contains an instance of a type that inherits from <xref:System.Windows.Forms.Control>, such as a <xref:System.Windows.Forms.Button> or <xref:System.Windows.Forms.ComboBox>. Then name the instance `Control1` and ensure that the event handler is associated with the <xref:System.Windows.Forms.Control.Paint?displayProperty=nameWithType> event.
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet42":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet42":::
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Rectangle" />
</Docs>
</Member>
<MemberGroup MemberName="Dispose">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Releases the resources used by the <see cref="T:System.Windows.Forms.PaintEventArgs" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="paintEventArgs.Dispose " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the <see cref="T:System.Windows.Forms.PaintEventArgs" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call <xref:System.Windows.Forms.PaintEventArgs.Dispose> when you are finished using the <xref:System.Windows.Forms.PaintEventArgs>. The <xref:System.Windows.Forms.PaintEventArgs.Dispose> method leaves the <xref:System.Windows.Forms.PaintEventArgs> in an unusable state. After calling <xref:System.Windows.Forms.PaintEventArgs.Dispose>, you must release all references to the <xref:System.Windows.Forms.PaintEventArgs> so the garbage collector can reclaim the memory that the <xref:System.Windows.Forms.PaintEventArgs> was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
> [!NOTE]
> Always call <xref:System.Windows.Forms.PaintEventArgs.Dispose> before you release your last reference to the <xref:System.Windows.Forms.PaintEventArgs>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Windows.Forms.PaintEventArgs> object's `Finalize` method.
]]></format>
</remarks>
<related type="Article" href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</related>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit" Usage="paintEventArgs.Dispose disposing" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual void Dispose(bool disposing);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.PaintEventArgs" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public `Dispose()` method and the <xref:System.Object.Finalize> method, if it has been overridden. `Dispose()` invokes the protected <xref:System.Windows.Forms.PaintEventArgs.Dispose%28System.Boolean%29> method with the `disposing` parameter set to `true`. `Finalize` specifies the `disposing` parameter as `false`.
When the `disposing` parameter is true, this method releases all resources held by any managed objects that this <xref:System.Windows.Forms.PaintEventArgs> references. This method invokes the `Dispose()` method of each referenced object.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>
<see langword="Dispose" /> can be called multiple times by other objects. When overriding <see langword="Dispose(Boolean)" />, be careful not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see <see href="/dotnet/standard/garbage-collection/implementing-dispose">Implementing a Dispose Method</see>.
For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see <see href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</see> and <see href="https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)">Overriding the Finalize Method</see>.</para>
</block>
<related type="Article" href="/dotnet/standard/garbage-collection/implementing-dispose">Implementing a Dispose method</related>
<related type="Article" href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</related>
</Docs>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="~PaintEventArgs ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.Finalize" />
<MemberSignature Language="VB.NET" Value="Finalize ()" />
<MemberSignature Language="F#" Value="override this.Finalize : unit -> unit" Usage="paintEventArgs.Finalize " />
<MemberSignature Language="C++ CLI" Value="!PaintEventArgs ()" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Graphics">
<MemberSignature Language="C#" Value="public System.Drawing.Graphics Graphics { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Graphics Graphics" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.PaintEventArgs.Graphics" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Graphics As Graphics" />
<MemberSignature Language="F#" Value="member this.Graphics : System.Drawing.Graphics" Usage="System.Windows.Forms.PaintEventArgs.Graphics" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Graphics ^ Graphics { System::Drawing::Graphics ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Graphics</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the graphics used to paint.</summary>
<value>The <see cref="T:System.Drawing.Graphics" /> object used to paint. The <see cref="T:System.Drawing.Graphics" /> object provides methods for drawing objects on the display device.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example demonstrates handling the <xref:System.Windows.Forms.Control.Paint> event and using the <xref:System.Windows.Forms.PaintEventArgs> class to draw rectangles on the form. The <xref:System.Windows.Forms.Control.MouseDown> and <xref:System.Windows.Forms.Control.MouseUp> events are handled to determine the size of the rectangle. The example also demonstrates the <xref:System.Windows.Forms.Control.Invalidate%2A> method to invalidate the area of the rectangle, causing it to be redrawn.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Demontrates Form Paint Event/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PaintEventArgs/Overview/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Demontrates Form Paint Event/VB/form1.vb" id="Snippet1":::
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Paint/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnPaint/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Graphics" />
</Docs>
</Member>
<Member MemberName="System.Drawing.IDeviceContext.GetHdc">
<MemberSignature Language="C#" Value="IntPtr IDeviceContext.GetHdc ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance native int System.Drawing.IDeviceContext.GetHdc() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.System#Drawing#IDeviceContext#GetHdc" />
<MemberSignature Language="VB.NET" Value="Function GetHdc () As IntPtr Implements IDeviceContext.GetHdc" />
<MemberSignature Language="F#" Value="abstract member System.Drawing.IDeviceContext.GetHdc : unit -> nativeint
override this.System.Drawing.IDeviceContext.GetHdc : unit -> nativeint" Usage="paintEventArgs.System.Drawing.IDeviceContext.GetHdc " />
<MemberSignature Language="C++ CLI" Value=" virtual IntPtr System.Drawing.IDeviceContext.GetHdc() = System::Drawing::IDeviceContext::GetHdc;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Drawing.IDeviceContext.GetHdc</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the handle to a Windows device context.</summary>
<returns>An <see cref="T:System.IntPtr" /> representing the handle of a device context.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.PaintEventArgs> instance is cast to an <xref:System.Drawing.IDeviceContext> interface.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="System.Drawing.IDeviceContext.ReleaseHdc">
<MemberSignature Language="C#" Value="void IDeviceContext.ReleaseHdc ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Drawing.IDeviceContext.ReleaseHdc() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.PaintEventArgs.System#Drawing#IDeviceContext#ReleaseHdc" />
<MemberSignature Language="VB.NET" Value="Sub ReleaseHdc () Implements IDeviceContext.ReleaseHdc" />
<MemberSignature Language="F#" Value="abstract member System.Drawing.IDeviceContext.ReleaseHdc : unit -> unit
override this.System.Drawing.IDeviceContext.ReleaseHdc : unit -> unit" Usage="paintEventArgs.System.Drawing.IDeviceContext.ReleaseHdc " />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Drawing.IDeviceContext.ReleaseHdc() = System::Drawing::IDeviceContext::ReleaseHdc;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Drawing.IDeviceContext.ReleaseHdc</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases the handle of a Windows device context.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Forms.PaintEventArgs> instance is cast to an <xref:System.Drawing.IDeviceContext> interface.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>