SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
A file/folder is added and application-specific contents can be added.
VB.NET | Private Sub object_UserContents(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.UserContents |
VB | Private Sub object_UserContents(Folder As SftDirectoryFolder, ByVal Contents As SftDirectoryContentsConstants, UserString As String) |
C#.NET | void object_UserContents(object sender, EventArgumentType e); |
VC++ | void OnUserContentsobject(ISftDirectoryFolder* Folder, enum SftDirectoryContentsConstants Contents, _bstr_t* UserString); |
C | HRESULT OnUserContentsobject(ISftDirectoryFolder* Folder, enum SftDirectoryContentsConstants Contents, BSTR* UserString); |
object
Folder
Describes the file/folder being added for which application-specific contents can be added.
Contents
Defines the column contents for which application-specific contents can be added.
Contents | Value | Description |
---|---|---|
contentsSftDirectoryUser1 | 51 | User defined 1 |
contentsSftDirectoryUser2 | 52 | User defined 2 |
contentsSftDirectoryUser3 | 53 | User defined 3 |
contentsSftDirectoryUser4 | 54 | User defined 4 |
contentsSftDirectoryUser5 | 55 | User defined 5 |
contentsSftDirectoryUser6 | 56 | User defined 6 |
contentsSftDirectoryUser7 | 57 | User defined 7 |
contentsSftDirectoryUser8 | 58 | User defined 8 |
contentsSftDirectoryUser9 | 59 | User defined 9 |
UserString
On return, provides a string containing the text added to the file/folder in the column described by Contents.
The UserContents event occurs when a file/folder is added and application-specific contents can be added.
The Column.Contents property determines the type of data displayed and loaded into a column. If a column contains application-specific data (contentsSftDirectoryUser1 - contentsSftDirectoryUser9), the UserContents event occurs for each file/folder being added and for each column.
The AutoInitialLoad property may need to be set to False so the control does not load its contents immediately. This may be necessary if user-defined contents are added in certain columns. The UserContents event may not occur when the control is initially created, due to certain environment restrictions. For example, in Visual Basic, the UserContents event is not generated until the Form_Load event has occurred. The control however is created before the Form_Load event occurs, preventing the UserContents events from being handled by the application. This in effect prevents any user-defined contents 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.
AxSftDirectory1.GridStyle = SftDirectoryGridStyleConstants.gridSftDirectoryBoth AxSftDirectory1.Headers.Style = SftDirectoryHeadersStyleConstants.headersSftDirectoryButton AxSftDirectory1.get_ColumnEntry(0).HeaderText = "Folder" AxSftDirectory1.get_ColumnEntry(1).HeaderText = "Full Path" AxSftDirectory1.get_ColumnEntry(1).Contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1 AxSftDirectory1.Reload(False, False) End Sub Private Sub AxSftDirectory1_UserContents(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_UserContentsEvent) Handles AxSftDirectory1.UserContents If e.contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1 Then e.userString = e.folder.Path End If End Sub
SftDirectory1.GridStyle = gridSftDirectoryBoth SftDirectory1.Headers.Style = headersSftDirectoryButton SftDirectory1.ColumnEntry(0).HeaderText = "Folder" SftDirectory1.ColumnEntry(1).HeaderText = "Full Path" SftDirectory1.ColumnEntry(1).Contents = contentsSftDirectoryUser1 SftDirectory1.Reload False, False End Sub Private Sub SftDirectory1_UserContents(ByVal Folder As SftDirectoryLib30.ISftDirectoryFolder, ByVal Contents As SftDirectoryLib30.SftDirectoryContentsConstants, UserString As String) If Contents = contentsSftDirectoryUser1 Then UserString = Folder.Path End If End Sub
axSftDirectory1.GridStyle = SftDirectoryGridStyleConstants.gridSftDirectoryBoth; axSftDirectory1.Headers.Style = SftDirectoryHeadersStyleConstants.headersSftDirectoryButton; axSftDirectory1.get_ColumnEntry(0).HeaderText = "Folder"; axSftDirectory1.get_ColumnEntry(1).HeaderText = "Full Path"; axSftDirectory1.get_ColumnEntry(1).Contents = SftDirectoryContentsConstants.contentsSftDirectoryUser1; axSftDirectory1.Reload(false, false); } private void axSftDirectory1_UserContents(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_UserContentsEvent e) { if (e.contents == SftDirectoryContentsConstants.contentsSftDirectoryUser1) { e.userString = e.folder.Path; } }
m_vDir1->ColumnEntry[0]->HeaderText = _T("Folder"); m_vDir1->ColumnEntry[1]->HeaderText = _T("Full Path"); m_vDir1->ColumnEntry[1]->Contents = contentsSftDirectoryUser1; m_vDir1->Reload(VARIANT_FALSE, VARIANT_FALSE); return TRUE; // return TRUE unless you set the focus to a control } void CUserContentsDlg::OnUserContentsSftDirectory1(LPDISPATCH Folder, long Contents, BSTR FAR* UserString) { ISftDirectoryFolderPtr pFolder = Folder; if (Contents == contentsSftDirectoryUser1) { *UserString = SysAllocString(pFolder->Path); } }
See Also SftDirectory Object | Object Hierarchy