Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to disable the close button on a floating dock form Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
28-Oct-02
Category
VCL-Forms
Language
Delphi 2.x
Views
179
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

I want to know how to prevent an undocked control from destroying when I clicked on 
the X shaped close button on the right corner.

Answer:

You have to create your own docksite form:

1   type
2     TNoCloseDockform = class(TCustomDockForm)
3     private
4       procedure WMSysCommand(var msg: TWMSyscommand); message WM_SYSCOMMAND;
5     end;
6   
7     { TNoCloseDockform }
8   
9   procedure TNoCloseDockform.WMSysCommand(var msg: TWMSyscommand);
10  begin
11    if (msg.CmdType and $FFF0) = SC_CLOSE then
12      Msg.result := 0
13    else
14      inherited;
15  end;
16  
17  procedure TForm1.FormCreate(Sender: TObject);
18  begin
19    panel1.FloatingDockSiteClass := TNoCloseDockform;
20  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC