⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 218.htm

📁 水木清华BBS精华
💻 HTM
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>CTerm非常精华下载</title>
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="577">
<tr><td width="32%" rowspan="3" height="123"><img src="DDl_back.jpg" width="300" height="129" alt="DDl_back.jpg"></td><td width="30%" background="DDl_back2.jpg" height="35"><p align="center"><a href="http://bbs.tsinghua.edu.cn"><font face="黑体"><big><big>水木清华★</big></big></font></a></td></tr>
<tr>
<td width="68%" background="DDl_back2.jpg" height="44"><big><big><font face="黑体"><p align="center">         Delphi编程                            (BM: strayli FlyingBoy)          </font></big></big></td></tr>
<tr>
<td width="68%" height="44" bgcolor="#000000"><font face="黑体"><big><big><p   align="center"></big></big><a href="http://cterm.163.net"><img src="banner.gif" width="400" height="60" alt="banner.gif"border="0"></a></font></td>
</tr>
<tr><td width="100%" colspan="2" height="454"> <p align="center">[<a href="index.htm">回到开始</a>][<a href="178.htm">上一层</a>][<a href="219.htm">下一篇</a>]
<hr><p align="left"><small>发信人: capton (一刀斋), 信区: Visual <br>

标  题: 移动类CSTAR工具栏的方法(delphi) <br>

发信站: BBS 水木清华站 (Tue Apr  7 15:16:43 1998) <br>

  <br>

这是答以前的文章 <br>

  <br>

要移动无标题行的窗口(工具栏),可以采取两个办法: <br>

1.标准的办法: <br>

   自己捕捉鼠标事件,即MouseDown,MouseMove,MouseUp, <br>

原理很简单 ,但写起来就不大方便了。我这儿有一份有关 <br>

的源代码,要的话我可以贴上,不过看过第二种方法后就不 <br>

会想要了。 <br>

  <br>

2.简洁的办法: <br>

   捕捉wm_NCHitTest消息,使Windows认为鼠标点工具栏是 <br>

在点标题行。 <br>

   在窗口定义中加入一个消息函数 <br>

type <br>

  TForm1 = class(TForm) <br>

    ...... <br>

  private <br>

    procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest; <br>

  end; <br>



  <br>

函数体: <br>

procedure TForm1.WMNCHitTest(var M: TWMNCHitTest); <br>

begin <br>

  inherited;                    { call the inherited message handler } <br>

  if  M.Result = htClient then  { is the click in the client area?   } <br>

    M.Result := htCaption;      { if so, make Windows think it's     } <br>

                                { on the caption bar.                } <br>

end; <br>

然后当用户点拖用户区(工具栏)时,效果和点拖窗口的标题行是一样的。 <br>

这个办法我在Win3.x和Win95下都试过,很好用的。 <br>

  <br>

-- <br>

  爱喝汤的一刀斋 <br>

  <br>

※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.5.103] <br>

Rinch(小林)认为: <br>

这个办法有一个缺陷:当双击工具栏时会时工具栏最大化,要作的比较完善还是用 <br>

第一种方法。 <br>

</small><hr>
<p align="center">[<a href="index.htm">回到开始</a>][<a href="178.htm">上一层</a>][<a href="219.htm">下一篇</a>]
<p align="center"><a href="http://cterm.163.net">欢迎访问Cterm主页</a></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -