C ++ control Cheadctrl

xiaoxiao2021-03-06  72

HeaderCtrl is usually applied to the list of text or data in the window. Generally, the title of the data column may include a plurality of portions, and the user can drag each portion and control the width of each column. The header control class provides the basic method of normal header control, only in the Windows 95, which is included in the version of the system, which is included in the AFXCMN.H file, generally used in combination with the tag control (CTabCtrl) and list control (ClistCtrl). (1) Object structure 1, head control object, establishment of headerCtrl & CHEADERCTRL Creating Header Control Object Create Creating Head and Binding Object CheaderCtrl :: Create Format as follows: BOOL CREATE (DWord DWStyle, Const Rect & Rect) , Cwnd * pparentWnd, uint NID); its return value is not zero initialization, otherwise it will fail. The parameter DWSTYLE is used to determine the header control type; RECT is used to determine the size and position of the header control; the PARENTWND is used to determine the parent window of the header control; NID is used to represent the flag of the header control. The header control style includes: HDS_BUTTONS represents the top control appearance and a button; HDS_HORZ indicates that the header is controlled horizontally; HDS_VERT indicates that the header is controlled to vertical; HDS_HIDDEN indicates that the header control is hidden mode. It can also use ordinary type control style, including: CCS_BOTTOM setting control position at the bottom of the parent window, the same width as the parent window; CCS_NODIVIDER forms two pixels on the top; CCS_NOHILITE forms a pixel on the top of the control District; CCS_Nomovey resets the size and horizontal arrangement when responding to the WM_SIZE message; CCS_NoparentAlign enables control to automatically close to the top or bottom of the parent window; CCS_NORSIZE sets the initial size or new value to make the control usage default width and height; CCS_TOP set in the parent window customer area The top and the same width as the parent window; the same head control can also use the window control style, including: ws_child creates a sub-window, cannot be used for the WS_POPUP window type; WS_Visible builds an initial invisible window; WS_DISABLED establishes an initial time Invalid window; WS_GROUP determines the control group that can be moved by cursor; WS_TABSTOP determines that the TAB controls the mobile site; the header control is generally divided into two steps, first determines the data structure of the header control, and then establish the header control and bind the object. . 2. Attributes of the attribute header control of the header control include obtaining the number of projects in the header control, giving the contents of a project in the header control, and setting the contents of a project in the header control. 3, the operation method of the header control method head control includes inserting a new project INSERTITEM in the header control, deleting a project deleteItem and drawing the project DrawItem in the header from the header control.

转载请注明原文地址:https://www.9cbs.com/read-93070.html

New Post(0)