How can I drag a form without caption bar? |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
How can I drag a form without caption bar?Applies To: C Builder 1 or higher Category: Knowledge Base 資料來源: http://free.prohosting.com/~cbdn/ If I use a standard form, I can drag it using the caption bar. How can I drag a form without caption bar? 1. Start a new project using File | New Application. 2. Edit the OnMouseMove event:void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { // If left mouse button is clicked if(Shift.Contains(ssLeft)) { ReleaseCapture(); Perform(WM_NCLBUTTONDOWN, HTCAPTION, NULL); } }Each time the left mouse button is pressed over the caption bar, the WM_NCLBUTTONDOWN message is posted. You can simulate a caption bar click by sending this message. C Builder Developer's Network Copyright © Yoto Yotov 網路志工聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2002/08/28 10:42:36 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |