[CSPLitterWnd Tips] Change the size of the division window dragging bar

zhaozj2021-02-16  51

[CSPLitterWnd Tips] Change the size of the division window dragging bar

Author: enoloo

Everyone knows that the default CSPLitterWnd is wide, it looks for places, and it is not beautiful. How to change it? Studying the constructor of CSPLitterWnd is found that the width of the drag bar can be set. Here is a simple CMYSPLITTER class I wrote. His effect is as follows:

The following is the code of cmysplitter: ============================================= ============= // mysplitter.h # prgma overce # include "stdafx.h" class cmysplitter: public csplitterwnd {public: cmysplitter (); declare_dyncreate (cmysplitter)

Public: ~ cmysplitter (); protected:

DECLARE_MESSAGE_MAP ()}; ============================================= ============ // mysplitter.cpp # incrude "mysplitter.h"

Implement_dyncreate (CMYSPLITTER, CSPLITTERWND)

/ / Change the width and attribute of the division bar in the constructor! CMYSPLITTER :: CMYSPLITTER () {m_cxsplitter = 4; // Must> = 4 ; M_cxsplittergap = 1; // splitter dragbar width m_Cysplittergap = 1;}

CMYSPLITTER :: ~ cmysplitter () {

}

Begin_MESSAGE_MAP (CMYSPLITER, CSPLITTERW)

END_MESSAGE_MAP () =============================================== ========== When using, in the main window contains the header file mysplitter.h, it is possible to change the csplitterwnd to cmysplitter.

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

New Post(0)