Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:20:47+00:00 2026-06-17T19:20:47+00:00

I have a paint box which I want the user to be able to

  • 0

I have a paint box which I want the user to be able to undock and move around. So I set its DragKind to dkDock and its DragMode to dmAutomatic, and put it inside a panel with DockSite set to True. I’m experiencing a rather odd behavior when I dock the paint box after having undocked it to a floating form. The close button of the floating form appears inside the panel. I’ve attached two screenshots. One from the original state, and one after docking the paint box again. What am I missing?

Original State:

Before undocking

After docking:

After docking


UPDATE
After using TLama’s solution, here’s the result.

After Docking ; Using new dock manager

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:20:48+00:00Added an answer on June 17, 2026 at 7:20 pm

    You’re not missing anything. That’s how the default dock manager implementation works. It just wants to have grabber with the close button available on dock site, which uses it. What you can do, is implement your own dock manager and override its AdjustDockRect method, which controls the size of docking zone and where is in default dock manager implementation made a space for grabber with close button. If you don’t want that grabber, just keep the size of dock zone rectangle as it was passed to the method, in size of the whole dock site. In other words, do nothing in that method override.

    That’s for the functional part of the grabber, but except that you need to intercept hardcoded drawing of it. To do so, you need to override the PaintDockFrame event method and like before, do just nothing there.

    Here’s a code sample:

    type
      TNoGrabDockManager = class(TDockTree)
      protected
        procedure AdjustDockRect(Control: TControl; var ARect: TRect); override;
        procedure PaintDockFrame(Canvas: TCanvas; Control: TControl;
          const ARect: TRect); override;
      end;
    
    implementation
    
    { TNoGrabDockManager }
    
    procedure TNoGrabDockManager.AdjustDockRect(Control: TControl; var ARect: TRect);
    begin
      // here you can make space for a grabber by shifting top or left position
      // of the ARect parameter, which is by default set to the whole dock site
      // bounds size, so if you do nothing here, there will be no grabber
    end;
    
    procedure TNoGrabDockManager.PaintDockFrame(Canvas: TCanvas; Control: TControl;
      const ARect: TRect);
    begin
      // in this event method, the grabber with that close button are drawn, so
      // as in case of disabling grabber functionality do precisely nothing for
      // drawing it here, that will make it visually disappear
    end;
    

    Here’s how to use such custom dock manager (see below for note about UseDockManager property):

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Panel1.DockManager := TNoGrabDockManager.Create(Panel1);
      Panel1.UseDockManager := True;
    end;
    

    Important

    As few sources suggest, you should set the UseDockManager property of your dock panel to False at design time. I don’t know why, but from quick tests I’ve made, some of the event methods of the custom dock manager were not fired when I didn’t have set that property at design time (the AdjustDockRect event method worked properly even without doing so, but I wouldn’t personally rely on it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a popup confirm box which i am able to show like below.
I want to have a text box that the user can type in that
I have been trying to create a user control library which simply has styled
I have a dialog box that the user inserts various data through gui controls,
I have a databound combo box that lists Financial Years. The user selects a
I have a loop $(.box).find('.video, .print, .web').closest('.box').each(function (index) { $(this).delay(100 * index).fadeIn(300); }); This
I have a pictureBox1 paint event. In the paint event im writing to a
I have the following paint event (form) that is drawing the rectangle: void LogicSimulationViewerForm_Paint(object
I have external html5 canvas that you can paint on some lines using your
I have a QGraphicsObject derived class that holds a QImage and ovveride paint(QPainter *painter,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.