TabView_t::Draw

This method draws the tab controls for a property sheet.

static void Draw(
  HWND hwnd,
  HWND hwndParent,
  HDC hdc,
  RECT* prcClient,
  DWORD style,
  DWORD dwStyleEx,
  UINT flags,
  int tmHeight,
  int cItems,
  HIMAGELIST himl,
  HDPA hdpa,
  int cbExtra,
  int iSel,
  int iNewSel,
  int cxTabs,
  int iFirstVisible,
  int iLastVisible,
  int iLastTopRow
);

Parameters

  • hwnd
    [in] Handle to a window.
  • hwndParent
    [in] Handle to the parent window.
  • hdc
    [in] Handle to the device context.
  • prcClient
    [out] Pointer to a RECT structure that receives the coordinates of the rectangle in which you want to draw.
  • style
    [in] DWORD that specifies the style of the tab control. The following table shows the possible values.
    Tab control styles Description
    TCS_BOTTOM Displays the tabs at the bottom of the control. If the TCS_VERTICAL style is also specified, this style is interpreted as TCS_RIGHT.
    TCS_BUTTONS Displays all tabs as buttons with no border drawn around the display area.
    TCS_FIXEDWIDTH Specifies that all tabs are the same width. You cannot combine this style with the TCS_RIGHTJUSTIFY style.
    TCS_FLATBUTTONS Changes the appearance of a selected tab to indented while other tabs appear to be on the same plane as the background. This style only applies to tab controls that have the TCS_BUTTONS style.
    TCS_FLIP Flips all tabs from top to bottom or left to right.
    TCS_FOCUSNEVER Creates a tab control that never receives the input focus.
    TCS_FOCUSONBUTTONDOWN Specifies that a given tab, when selected, receives the input focus.
    TCS_FORCEICONLEFT Aligns an icon with the left edge of a fixed-width tab. This style can only be used with the TCS_FIXEDWIDTH style.
    TCS_FORCELABELLEFT Aligns a label with the left edge of a fixed-width tab; that is, it displays the label immediately to the right of the icon instead of centering it. This style can only be used with the TCS_FIXEDWIDTH style, and it implies the TCS_FORCEICONLEFT style.
    TCS_MULTILINE Displays multiple rows of tabs, if necessary, so that all tabs are visible at once.
    TCS_MULTISELECT Specifies that multiple tabs can be selected by holding down CTRL when selecting a tab. This style only applies to tabs that have the TCS_BUTTONS style.
    TCS_OWNERDRAWFIXED Specifies that the parent window is responsible for drawing tabs.
    TCS_RAGGEDRIGHT Leaves a ragged right edge by not stretching a row of tabs to fill the entire width of the control. This style is the default.
    TCS_RIGHT Displays multiple tabs vertically on the right side of controls that use the TCS_VERTICAL style. If the TCS_VERTICAL style is not specified, this style is interpreted as TCS_BOTTOM.
    TCS_RIGHTJUSTIFY Increases the width of each tab, if necessary, so that each row of tabs fills the entire width of the tab control. This style is valid only when it is used with the TCS_MULTILINE style.
    TCS_SCROLLOPPOSITE Specifies that unused tabs move to the opposite side of the control when a new tab is selected.
    TCS_SINGLELINE Displays only one row of tabs. The user can scroll to see more tabs, if necessary. This style is the default.
    TCS_VERTICAL Displays multiple tabs vertically on the left side of the control. This style is valid only when it is used with the TCS_MULTILINE style. To make tabs appear on the right side of the control, combine this style with the TCS_RIGHT style.
  • dwStyleEx
    [in] DWORD that specifies the extended style of the tab control. The following table shows the possible value.
    Value Description
    TCS_EX_FLATSEPARATORS Draws a separator between tab items in tab controls that have the TCS_BUTTONS or TCS_FLATBUTTONS style.
  • flags
    [in] Unsigned integer that specifies how to draw the tabs. The following table shows the possible values.
    Value Description
    TCF_BUTTONS Uses buttons instead of tabs when drawing the property sheet.
    TCF_DRAWSUNKEN Draws the button so that the button appears pressed.
    TCF_FONTCREATED Indicates that the font set the font for the tab.
    TCF_FONTSET Allows you to set the font for the tab.
    TCF_REDRAW Uses the state of the redraw flag from the WM_SETREDRAW message.
  • tmHeight
    [in] Integer that specifies the height of characters for the tab control.
  • cItems
    [in] Integer that specifies the number of tabs.
  • himl
    [in] Handle to an image list.
  • hdpa
    [in] Handle to a DPA structure.
  • cbExtra
    [in] Integer that specifies the number of extra bytes in the TCM_SETITEMEXTRA message.
  • iSel
    [in] Integer that specifies the index of the tab that you want to be selected.
  • iNewSel
    [in] Integer that specifies the index of the button that has the focus.
  • cxTabs
    [in] Integer that specifies the x-coordinate of the right edge of the region where the tab can be painted.
  • iFirstVisible
    [in] Integer that specifies the index of the first visible tab.
  • iLastVisible
    [in] Integer that specifies the index of the last visible tab.
  • iLastTopRow
    [in] Integer that specifies the index of the last tab in the top row of tabs.

Return Values

None.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Tabview.hpp.

See Also

TabView_t | TCM_SETITEMEXTRA | WM_SETREDRAW | DPA | RECT

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.