Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

SetControlInfo

Sets tab control attributes.

C

BOOL SftTabs_SetControlInfo(HWND hwndCtl, LPCSFTTABS_CONTROL lpCtl);

C++

BOOL CSftTabs::SetControlInfo(LPCSFTTABS_CONTROL lpCtl);

Parameters

hwndCtl

The window handle of the tab control.

lpCtl

A pointer to a SFTTABS_CONTROL structure. This structure will be used to define the new tab control attributes.

Returns

The return value is TRUE if the function was successful, otherwise FALSE is returned.

Comments

The SetControlInfo function sets tab control attributes.

If the SFTTABS_CONTROL structure defines a tab control that is invalid, the current tab control settings remain unchanged and the function returns FALSE. The following validations take place to insure that a tab control is valid:

  • the style specified in style has to be valid
  • nRows must be at least 1 and less or equal to the number of tabs
  • if nRows is > 1, the new tab style must support multiple rows of tabs
  • if leftMargin or rightMargin is > 1, the new tab style must support margins
  • if a specific number of tabs per row is defined (nRowTabs), tabs must be defined as fixed width tabs (fFixed)
  • if a client area is requested (fClientArea), the new tab style must support a client area
  • if a scrollable tab control is requested (fScrollable), the new tab style must support scrollable tabs
  • if a scrollable tab control is requested (fScrollable), the number of tab rows requested must be one (nRows)
  • if a scrollable tab control is requested (fScrollable), the tab rows cannot be filled completely (fFillComplete)
  • if a scroll button bitmap handle is supplied (hButtonBitmap and hButtonBitmapDisabled), the handles must be valid or NULL
  • if hidden scroll buttons are requested (fHideScrollButtons), the tab control must be defined as scrollable (fScrollable)
  • if multiline tab text is requested, the new tab style must support multiline tab text
  • if conditional scroll buttons are requested (fCondScrollButtons), the tab control must be defined as scrollable (fScrollable)
  • conditional scroll buttons (fCondScrollButtons) and hidden scroll buttons (fHideScrollButtons) are mutually exclusive
  • the button style (buttonStyle) specified must be a valid style
  • if scroll buttons are requested on the left/top (fScrollOnLeft), the tab control must be defined as scrollable (fScrollable)
  • if a bitmap is specified for the Minimize, Restore and Close buttons (hButtonBitmap2), it must be a valid bitmap handle
  • if a disabled images bitmap is specified for the Minimize, Restore and Close buttons (hButtonBitmap2Disabled), it must be a valid bitmap handle
  • the scroll button alignment (buttonAlignment) must be valid
  • the Minimize, Restore and Close button alignment (closeButtonAlignment) must be valid

Example

This example retrieves the current tab control attributes and modifies the number of tab rows:

C

SFTTABS_CONTROL Ctl;
SftTabs_GetControlInfo(hwndTab, &Ctl);
Ctl.nRows = 1;
SftTabs_SetControlInfo(hwndTab, &Ctl);

C++

SFTTABS_CONTROL Ctl;
m_Tab.GetControlInfo(&Ctl);
Ctl.nRows = 1;
m_Tab.SetControlInfo(&Ctl);

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.