Unicode Controls & Classes for VB6 - Version 4

ctlUniMenu.OnOwnerDraw Event

Raised when a menu item is about to be drawn. Change properties of this event for translating items
at runtime or assign icons to menu items. This event is called the first time for measuring the item
then every time the item needs to be refreshed

Syntax
Public Event OnOwnerDraw (ByRef sItemText As String,
ByRef oItemPic As StdPicture,
ByRef iItemPicWidth As Integer,
ByRef iItemPicHeight As Integer,
ByRef bItemPicTransp As Boolean,
ByVal bItemSelected As Boolean)
Parameters
Parameter Description
ByRef sItemText As String (IN/OUT) The item text
ByRef oItemPic As StdPicture (IN/OUT) The item pic
ByRef iItemPicWidth As Integer (IN/OUT) The item pic width
ByRef iItemPicHeight As Integer (IN/OUT) The item pic height
ByRef bItemPicTransp As Boolean (IN/OUT) The item pic transparency (if Transparent, the pixel at coordinates 0,0 will be treated as transparent)
ByVal bItemSelected As Boolean (IN/OUT) Is the item selected?
Remarks
Private Sub MDIForm_Load()
ctlUniMDITabs1.Attach Me.hWnd

Unload frmSplash

With ctlUniMenu1
.FadeBackground = True

.ExtSepBackColor = vbWhite
.ExtSepForeColor = vbBlue
.FadeExtSep = False

.Attach Me.hWnd
End With
End Sub
Private Sub ctlUniMenu1_OnOwnerDraw(sItemText As String, _
oItemPic As stdole.StdPicture, iItemPicWidth As Integer, _
iItemPicHeight As Integer, bItemPicTransp As Boolean, _
ByVal bItemSelected As Boolean)

Select Case sItemText

Case mnuNew.Caption
Set oItemPic = MDIForm1.ctlImageBag1.GetPicture(eim_new)

Case mnuSaveAs.Caption
Set oItemPic = MDIForm1.ctlImageBag1.GetPicture(eim_save)

Case mnuUndo.Caption
Set oItemPic = MDIForm1.ctlImageBag1.GetPicture(eim_undo)

Case mnuRedo.Caption
Set oItemPic = MDIForm1.ctlImageBag1.GetPicture(eim_redo)

End Select
End Sub