event OwnerDrawStart (Panel as Panel, hDC as Long, ByRef DefaultPainting as Boolean)
Starts painting the owner draw panel.

TypeDescription
Panel as Panel A Panel object being painted
hDC as Long A long expression that indicates the handle to the painting device context ( HDC )
DefaultPainting as Boolean (By Reference) A Boolen expression that indicates whether the default painting should be performed or not. If the DefaultPainting parameter is True, the control paints the part as default, else the panel is not painted by the control so the user should draw the panel.
The OwnerDrawStart event is fired when a panel requires to be painted. The OwnerDrawStart event is fired before erasing and painting the panel. The OwnerDrawStart event is fired only for owner draw panels. Use the OwnerDraw property to specify which panel is owner draw and which panel is not. You can use the OwnerDrawStart event to avoid painting any panel using the DefaultPainting parameter. The control fires the  OwnerDrawEnd event when painting the panel is done. Use the OwnerDrawStart event to perform painting panel before default implementation is called. For instance, if the owner panel pains a transparent or lucent skin, the OwnerDrawStart event lets you paint the panel before putting the default skin. The rectangle that should be painted in the device context can be retrieved using the GetClipBox API function

 

Syntax for OwnerDrawStart event, /NET version, on:

private void OwnerDrawStart(object sender,exontrol.EXSTATUSBARLib.Panel Panel,int hDC,ref bool DefaultPainting)
{
}

Private Sub OwnerDrawStart(ByVal sender As System.Object,ByVal Panel As exontrol.EXSTATUSBARLib.Panel,ByVal hDC As Integer,ByRef DefaultPainting As Boolean) Handles OwnerDrawStart
End Sub

Syntax for OwnerDrawStart event, /COM version, on:

private void OwnerDrawStart(object sender, AxEXSTATUSBARLib._IStatusBarEvents_OwnerDrawStartEvent e)
{
}

void OnOwnerDrawStart(LPDISPATCH Panel,long hDC,BOOL FAR* DefaultPainting)
{
}

void __fastcall OwnerDrawStart(TObject *Sender,Exstatusbarlib_tlb::IPanel *Panel,long hDC,VARIANT_BOOL * DefaultPainting)
{
}

procedure OwnerDrawStart(ASender: TObject; Panel : IPanel;hDC : Integer;var DefaultPainting : WordBool);
begin
end;

procedure OwnerDrawStart(sender: System.Object; e: AxEXSTATUSBARLib._IStatusBarEvents_OwnerDrawStartEvent);
begin
end;

begin event OwnerDrawStart(oleobject Panel,long hDC,boolean DefaultPainting)
end event OwnerDrawStart

Private Sub OwnerDrawStart(ByVal sender As System.Object, ByVal e As AxEXSTATUSBARLib._IStatusBarEvents_OwnerDrawStartEvent) Handles OwnerDrawStart
End Sub

Private Sub OwnerDrawStart(ByVal Panel As EXSTATUSBARLibCtl.IPanel,ByVal hDC As Long,DefaultPainting As Boolean)
End Sub

Private Sub OwnerDrawStart(ByVal Panel As Object,ByVal hDC As Long,DefaultPainting As Boolean)
End Sub

LPARAMETERS Panel,hDC,DefaultPainting

PROCEDURE OnOwnerDrawStart(oStatusBar,Panel,hDC,DefaultPainting)
RETURN

Syntax for OwnerDrawStart event, /COM version (others), on:

<SCRIPT EVENT="OwnerDrawStart(Panel,hDC,DefaultPainting)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function OwnerDrawStart(Panel,hDC,DefaultPainting)
End Function
</SCRIPT>

Procedure OnComOwnerDrawStart Variant llPanel Integer llhDC Boolean llDefaultPainting
	Forward Send OnComOwnerDrawStart llPanel llhDC llDefaultPainting
End_Procedure

METHOD OCX_OwnerDrawStart(Panel,hDC,DefaultPainting) CLASS MainDialog
RETURN NIL

void onEvent_OwnerDrawStart(COM _Panel,int _hDC,COMVariant /*bool*/ _DefaultPainting)
{
}

function OwnerDrawStart as v (Panel as OLE::Exontrol.StatusBar.1::IPanel,hDC as N,DefaultPainting as L)
end function

function nativeObject_OwnerDrawStart(Panel,hDC,DefaultPainting)
return

The following VB sample displays a curve in the owner draw panel:

Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type
Private Type POINTAPI
        x As Long
        y As Long
End Type

Private Declare Function GetClipBox Lib "gdi32" (ByVal hdc As Long, lpRect As RECT) As Long
Private Declare Function PolyBezier Lib "gdi32" (ByVal hdc As Long, lppt As POINTAPI, ByVal cPoints As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long

Private Sub StatusBar1_OwnerDrawStart(ByVal Panel As EXSTATUSBARLibCtl.IPanel, ByVal hdc As Long, DefaultPainting As Boolean)
    Dim r As RECT
    GetClipBox hdc, r
    hPen = CreatePen(0, 3, RGB(255, 0, 0))
    hOPen = SelectObject(hdc, hPen)
    r.Left = r.Left + 4
    r.Right = r.Right - 4
    r.Top = r.Top + 4
    r.Bottom = r.Bottom - 4
    Dim p(7) As POINTAPI
    p(0).x = r.Left
    p(0).y = r.Bottom
    p(1).x = (r.Left + r.Right) / 2
    p(1).y = r.Top
    p(2).x = r.Left
    p(2).y = r.Top
    p(3).x = 2 * (r.Left + r.Right) / 3
    p(3).y = (r.Bottom + r.Top) / 2
    p(4).x = 2 * (r.Left + r.Right) / 3
    p(4).y = r.Top
    p(5).x = 4 * (r.Left + r.Right) / 5
    p(5).y = (r.Bottom + r.Top) / 3
    p(6).x = r.Right
    p(6).y = r.Bottom
    PolyBezier hdc, p(0), 7
    SelectObject hdc, hOPen
    DeleteObject hOPen
End Sub

The following C++ sample displays a curve in the owner draw panel:

void OnOwnerDrawStartStatusbar1(LPDISPATCH Panel, long hDC, BOOL FAR* DefaultPainting) 
{
	HDC h = (HDC)hDC;
	RECT r = {0};

	GetClipBox( h, &r );
	CPanel panel(Panel);
	panel.m_bAutoRelease = FALSE;
	POINT p[7] = {(0,0)};
	HPEN hPen = CreatePen( PS_SOLID, 3, RGB(255,0,0) );
	HPEN hOPen = (HPEN)::SelectObject( h, hPen );
	InflateRect( &r, -4, -4 );

	p[0].x = r.left;
	p[0].y = r.bottom;
	p[1].x = (r.left + r.right) / 2;
	p[1].y = r.top;
	p[2].x = r.left;
	p[2].y = r.top;
	p[3].x = 2 * (r.left + r.right) / 3;
	p[3].y = (r.bottom + r.top) / 2;
	p[4].x = 2 * (r.left + r.right) / 3;
	p[4].y = r.top;
	p[5].x = 4 * (r.left + r.right) / 5;
	p[5].y = (r.bottom + r.top) / 3;
	p[6].x = r.right;
	p[6].y = r.bottom;
	PolyBezier( h, p, 7 );

	::SelectObject( h, hOPen );
	DeleteObject( hPen );
}