MultiSelect for WinForms
SelectObject メソッド
使用例 

C1.Win.Input.6 アセンブリ > C1.Framework.Drawing.Gdi.DeviceContexts 名前空間 > DeviceContext クラス : SelectObject メソッド
A System.IntPtr that indicates the handle to the gdi object to be selected.
Selects an object into the specified device context(DC). The new object replaces the previous object of the same type.
シンタックス
'宣言
 
Public Function SelectObject( _
   ByVal gdiObjectHandle As System.IntPtr _
) As System.IntPtr
public System.IntPtr SelectObject( 
   System.IntPtr gdiObjectHandle
)

パラメータ

gdiObjectHandle
A System.IntPtr that indicates the handle to the gdi object to be selected.

戻り値の型

Returns the handle of the previous gdi object of the same type.
解説
Note: When the handle of a gdi object is selected to DeviceContext, the properties of the gdi object can not changed and the gdi object can not be disposed.
使用例
//
// Paints a rectangle that is single black border and filled with white.
//
using (Pen pen = new SolidPen(Color.Black))
{
using (Brush brush = new SolidBrush(Color.Wheat))
{
DeviceContext dc = DeviceContext.Screen;
IntPtr defaultPenHandle = dc.SelectObject(pen.Handle);
IntPtr defaultBrushHandle = dc.SelectObject(brush.Handle);

dc.PaintRectangle(new Rectangle(0, 0, 100, 100));

dc.SelectObject(defaultPenHandle);
dc.SelectObject(defaultBrushHandle);
}
}
参照

DeviceContext クラス
DeviceContext メンバ