SftDirectory 2.5

SftDirectory.UserPicture Event

Softel vdm, Inc.

A file/folder is added/refreshed and an application-specific image can be defined.

Syntax       

VB.NET

Private Sub object_UserPicture(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.UserPicture

VB

Private Sub object_UserPicture(Folder As SftDirectoryFolder, Picture As IPictureDisp)

C#.NET

void object_UserPicture(object sender, EventArgumentType e);

VC++

void OnUserPictureobject(ISftDirectoryFolder* Folder, IPictureDisp** Picture);

C

HRESULT OnUserPictureobject(ISftDirectoryFolder* Folder, IPictureDisp** Picture);

Delphi

procedure objectUserPicture(Sender: TObject; Folder : ISftDirectoryFolder; var Picture : IPictureDispLanguage-specific information);

object

A SftDirectory object.

Folder

Describes the folder being added/refreshed for which an application-specific image can be defined.

Picture

On return, defines the image to be used as the folder's Picture property.  If Picture is set to NULL (Nothing), the default image is displayed for the folder.  It is not possible to remove an image, unless a blank bitmap is used.

Comments

The UserPicture event occurs when a file/folder is added/refreshed and an application-specific image can be defined.

The AutoInitialLoad property may need to be set to False so the control does not load its contents immediately.  This may be necessary if application-defined images are used for certain folders.  The UserPicture event may not occur when the control is initially created, due to certain environment restrictions.  For example, in Visual Basic, the UserPicture event is not generated until the Form_Load event has occurred.  The control however is created before the Form_Load event occurs, preventing the UserPicture events from being handled by the application. This in effect prevents any application-defined images from being added to the control.  The solution is to set AutoInitialLoad to False and use the control's Reload method in the Form_Load event.  Setting AutoInitialLoad to False isn't absolutely necessary, but it may save processing time as the control contents are only loaded once, in response to the Reload method.


Feedback / comments / error reports for this topic
© 2003, 2008 - Softel vdm, Inc. - www.softelvdm.com