发信人: lofe ()感激生活(), 信区: BorlandDev
标 题: Made a splitter window
发信站: 哈工大紫丁香 (Mon Sep 4 16:03:27 2000), 转信
A: The following steps and code demonstrate how to make a
simple splitter window.
1) Put a memo on a form and set its Align property to alTop.
2) Place a panel on the form and set its Align property to alTop.
3) Set the panel's Height property to 6 or 7.
4) Set the panel's DragMode property to dmAutomatic.
5) Set the panel's DragCursor property to crVSplit.
6) Set the panel's Cursor property to crVSplit.
7) Add another memo on the form and set its Align property to
alClient.
8) Now select both memos and the panel, and connect them all
to this OnDragOver handler:
procedure TForm1.Memo1DragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
begin
Accept := False;
if Source = Panel1 then begin
Accept := True;
Memo1.Height := Y + (Sender as TControl).Top;
end;
end;
--
------------------------
放荡齐赵间,裘马颇轻狂
※ 修改:.haojs 于 Sep 4 16:01:04 修改本文.[FROM: bbs.hit.edu.cn]
--
※ 转寄:.武汉白云黄鹤站 bbs.whnet.edu.cn.[FROM: bbs.hit.edu.cn]
--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: haojs.bbs@bbs.whnet.]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.601毫秒