WS_CLIPCHILDREN与WS_CLIPSIBLINGS

 英文单词解释
clip:夹子、子弹夹、回形针;夹住,修剪
sibling:同胞兄弟或姐妹
overlapped:重叠

这两个Window Stype的特性与异同素来不太清楚,今日作一笔记:
MSDN的解释为:
  • WS_CLIPCHILDREN   Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window.

  • WS_CLIPSIBLINGS   Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only.

    此处另有一文的解释为:
     
    JohnCz
    06-27-2006, 09:40 PM
    It is not a property per se.
    WS_xxx are Window styles. Both clip of area of other window when window overlaps another window.
    Clip sibling for example will cause MDI child window to paint itself over another child window (sibling) when overlapped. The same will happen

    WS_CLIPCHILDREN will do exactly the same when parent overlaps child window.

    综上所述
    WS_CLIPCHILDREN,使得父窗体在绘制时留出其上的子窗体的位置不去画它,而那片区域留着子窗体去画。
    WS_CLIPSIBLING,必须用于子窗体,使得该子窗体在收到WM_PAINT时同时令其共父的诸多子窗体(MSDN讲必须不在该区域,即不与之重叠)也会被PAINT。
    所有的overlapped窗口和popup窗口,都有WS_CLIPSIBLINGS 属性,
    这些窗口不能在它的sibling窗口上绘图

    对于child窗口,如果没有这个属性,它能在它的sibling窗口上绘图

                     +-----------+
                      |A             |
                      |   +--------+-------
                      |   |            |     B |
                      |   |  C        |        |
                     +---+-------+       |
                          |                    |
                          +---------------+
    如果A, B都是child窗口,
    如果A具有WS_CLIPSIBLINGS属性,
    那么A重绘时不会重绘C部分

    clip是裁减,去除的意思 相当与英文的Exclude
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值