SetIcons Method
Description
Used when more than one icon will be used to display the popup control item. This is used if the icon will use a different icon on mouse over or when the item is clicked. When adding an icon with this method, the icons need to be added together in the same bitmap file for all three cases. So the bitmap has all three identically sized icons side-by-side in the same BMP file: one for normal use, one for mouse over, and one for on click. This method is also used when you need to specify a mask color for your icon(s).
Syntax
Public Sub SetIcons( _
ByVal [Handle](#) As Integer, _
ByVal [TransparentColor](#) As ULong, _
ByVal [itemIcon](#) As [XTPPopupItemIcon](XtremeSuiteControls~Enumerations~XTPPopupItemIcon_EN.md) _
)
Parameters
| Parameter | Description |
|---|---|
| Handle | The handle of the popup control item. |
| TransparentColor | The color that will be treated as transparent in the icon. |
| itemIcon | Specifies the icon states for the popup control item. |
| xtpPopupItemIconNormal | Specifies that the popup control item's icon will only have a "normal" state. This means that the same icon is displayed regardless of any mouse over or clicking of the icon. |
| xtpPopupItemIconSelected | Specifies that the popup control item's icon will display a different icon when in a "selected" state (i.e., on mouse over). |
| xtpPopupItemIconPressed | Specifies that the popup control item's icon will display a different icon when the icon is clicked. |
Remarks
Suite Pro's popup control allows you to add icons that display a different icon on mouse over and when the icon is clicked. You can add standalone icons or you can add icons to be displayed in a button control. Suite Pro's popup control provides a built-in button control that automatically creates a normal, mouse over, and clicked icon. You can easily add buttons that use your custom icons or you can use the icons that the popup control automatically creates for you. You can even add an icon that acts like a button by adding a normal, mouse over, and on click icon.
Example
Icon Example 1 (Visual Basic)
This sample code illustrates how to add an icon that will display a different icon on mouse over and when the icon is clicked.
Dim Item As PopupControlItem
Set Item = PopupControl.AddItem(151, 6, 164, 19, "")
Item.SetIcons LoadBitmap("Icons\CloseMSN.bmp"), 0, xtpPopupItemIconNormal Or xtpPopupItemIconSelected Or xtpPopupItemIconPressed
Item.Id = IDCLOSE
Icon Example 2 (Visual Basic)
This sample code illustrates how to add an icon that will be a button.
Dim Item As PopupControlItem
Set Item = PopupControl.AddItem(115, 102, 160, 120, "")
Item.SetIcons LoadBitmap("Icons\LogoMSN.bmp"), 0, xtpPopupItemIconNormal
Item.Button = True
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.