"VC Programming Tips" form? 3.9 static window split (fixed split line)

Source: Internet
Author: User

The previous section explains how to split the window in a static way, split the window after the split line can be dragged, sometimes we need to fix the split line, then how to achieve fixed segmentation?


We need to construct a fixed split window class (Cfixedsplitterwnd) to implement our fixed segmentation of Windows, described in the previous chapter.

1. New MFC classes are created, inherited from CSplitterWnd, and overloaded with Wm_lbuttondown, wm_mousemove, and wm_setcursor message response functions.

2. The newly constructed Cfixedsplitterwnd uses the same method as the CSplitterWnd.


With the MFC Class Wizard, when you construct Cfixedsplitterwnd, you cannot find the base class CSplitterWnd, you can select CWnd first and then manually change the base class to CSplitterWnd.


Overloaded Wm_lbuttondown, wm_mousemove, and wm_setcursor message response functions

Cfixedsplitterwndメッセージハンドラーvoid Cfixedsplitterwnd::onlbuttondown (UINT nflags, CPoint point) {//todo:ここにメッセージハンドラー コードを additional するか, established Hishinuma accolades out します. Csplitterwnd::onlbuttondown (nflags, point); Cwnd::onlbuttondown (nflags, point);} void Cfixedsplitterwnd::onmousemove (UINT nflags, CPoint point) {//Todo:ここにメッセージハンドラーコードを append するか, established Hishinuma, accolades out します. Csplitterwnd::onmousemove (nflags, point); Cwnd::onmousemove (nflags, point);} BOOL cfixedsplitterwnd::onsetcursor (cwnd* pWnd, uint nhittest, UINT message) {//Todo:ここにメッセージハンドラーコードを append するか, The established Hishinuma accolades out します. Return Csplitterwnd::onsetcursor (pWnd, nhittest, message); return Cwnd::onsetcursor (PWnd, nhittest, message);}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.