property ExMenu.Picture as IPictureDisp
Retrieves or sets the background's picture.

 TypeDescription 
   IPictureDisp A Picture object being displayed on the control's background.  

Use the Picture property to put a picture on the control's background. Use the PictureDisplay to arrange the picture on the control's background. Use the Picture property to load a picture on the drop down menu's background. Use the BackColor property to specify the control's background color. Use the SelBackColor and SelForeColor properties to define colors for selected item.

The following VB sample puts a picture on the control's background:

With ExMenu1
        .PictureDisplay = Tile
        .Picture = LoadPicture("c:\WinNT\Zapotec.bmp")
End With 

The following C++ sample puts a picture on the control's background:

IPictureDisp* pPicture = NULL;
if ( LoadPicture( "c:\\winnt\\zapotec.bmp", &pPicture ) )
{
	m_menu.SetPicture( pPicture );
	m_menu.SetPictureDisplay( 48 /*Tile*/ );
}

where the LoadPicture function gets the IPictureDisp from a file:

The following VB.NET sample puts a picture on the control's background:

With AxExMenu1
    .Picture = Image.FromFile("c:\winnt\zapotec.bmp")
    .PictureDisplay = EXMENULib.PictureDisplayEnum.Tile
End With

The following C# sample puts a picture on the control's background:

axExMenu1.Picture = Image.FromFile("c:\\winnt\\zapotec.bmp");
axExMenu1.PictureDisplay = EXMENULib.PictureDisplayEnum.Tile;

The following VFP sample puts a picture on the control's background:

With thisform.ExMenu1
        .PictureDisplay = 48 && Tile
        .Picture = LoadPicture("c:\WinNT\Zapotec.bmp")
EndWith 

 


Send comments on this topic.
© 1999-2007 Exontrol Inc, Software. All rights reserved.