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
Defines a background bitmap used as the background for the tree control.
C
BOOL WINAPI SftTree_SetBackgroundBitmap(HWND hwndCtl, HBITMAP hBitmap, UINT flag, int xOffs, int yOffs); BOOL WINAPI SftTreeSplit_SetBackgroundBitmap(HWND hwndCtl, HBITMAP hBitmap, UINT flag, int xOffs, int yOffs);
C++
BOOL SetBackgroundBitmap(int val = 0, UINT flag = 0, int xOffs = 0, int yOffs = 0); BOOL SetBackgroundBitmap(const CBitmap& Bitmap, UINT flag = 0, int xOffs = 0, int yOffs = 0);
hwndCtl
The window handle of the tree control.
hBitmap, Bitmap
Describes the bitmap used as the background throughout the tree control. Any reasonable size bitmap can be used.
flag
Defines additional effects:
SFTTREE_BGBITMAP_CENTER | The background bitmap is vertically and horizontally centered in the client area of the tree control. The background bitmap is not tiled. Bitmap transparency is used for this display style. |
SFTTREE_BGBITMAP_HSCROLL | The background bitmap is scrolled horizontally when the tree control is scrolled horizontally. The background bitmap is tiled if the background bitmap is too small to fill the entire client area of the tree control. Bitmap transparency is not used for this display style. |
0 | The background bitmap is not scrolled horizontally. The background bitmap is tiled if the background bitmap is too small to fill the entire client area of the tree control. Bitmap transparency is not used for this display style. |
xOffs
Specifies a horizontal offset, relative to the top left edge of the tree control window. xOffs and yOffs describe a point relative to the top left edge of the tree control with which the bitmap should be aligned. The background bitmap is aligned with the top left edge of the tree control window (not the client area) if 0 is specified. This value is ignored when SFTTREE_BGBITMAP_CENTER is used.
yOffs
Specifies a vertical offset, relative to the top left edge of the tree control window. xOffs and yOffs describe a point relative to the top left edge of the tree control with which the bitmap should be aligned. The background bitmap is aligned with the top left edge of the tree control window (not the client area) if 0 is specified. This value is ignored when SFTTREE_BGBITMAP_CENTER is used.
val
The only allowable value is 0, which is used to clear the background bitmap.
The return value is TRUE if the function was successful, otherwise FALSE.
The SetBackgroundBitmap function defines a background bitmap used as the background for the tree control.
There is no default background bitmap. Bitmap transparency is only used if flag is defined as SFTTREE_BGBITMAP_CENTER.
If the background bitmap is too small to fill the entire client area of the tree control, it is tiled unless flag is defined as SFTTREE_BGBITMAP_CENTER. The row header area, row/column header area and column header do not display the background bitmap. These areas are not transparent.
If a background bitmap is used, the background colors defined for the tree control, columns and cells should be set to the default value SFTTREE_NOCOLOR so these do not interfere with the background bitmap.
When using the extended window style WS_EX_RIGHT for right-to-left reading support, the bitmap origin is the top, right corner of the tree control window. xOffs and yOffs specify offsets relative to the top right edge of the tree control window. In this case the bitmap is also tiled right to left.
Background bitmaps may cause slow repainting of the control, particularly on older systems and when the window area is unusually large.
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1))); // LEFT SIDE TREE CONTROL m_hwndLeftTree = GetDlgItem(hwndDlg, IDC_LEFTTREE); /* Define the background bitmap. */ m_hBgBitmap = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));/* Load a background bitmap */ SftTree_SetBackgroundBitmap(m_hwndLeftTree, m_hBgBitmap, 0, 0, 0);/* Define the background bitmap */ /* Register the item pictures. These pictures are used */ /* for all items in the tree control. All three pictures */ /* must be the same size. */ Sft_InitPicture(&m_aThreeItemPictures[0]); Sft_InitPicture(&m_aThreeItemPictures[1]); Sft_InitPicture(&m_aThreeItemPictures[2]); Sft_SetPictureBitmap(&m_aThreeItemPictures[0], LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_EXPANDABLE)));/* Expandable picture */
/* resource with the C++ object. */ m_LeftTree.SubclassDlgItem(IDC_LEFTTREE, this /* parent window */); /* You could use DDX/DDV instead and add the following */ /* line to the DoDataExchange function of the tree */ /* control's parent window (remove the //). */ // DDX_Control(pDX, IDC_LEFTTREE, m_LeftTree); m_BgBitmap.LoadBitmap(IDB_BACKGROUND);/* Load a background bitmap */ m_LeftTree.SetBackgroundBitmap(m_BgBitmap);/* Define the background bitmap */ /* Register the item pictures. These pictures are used */ /* for all items in the tree control. All three pictures */ /* must be the same size. */ { SFT_PICTURE aPic[3]; Sft_InitPicture(&aPic[0]);
See Also C/C++ API | Categories | Notifications