tToolBar and Close

Hiy'all :)

  Ok, simple one now...  I have a toolbar (tToolbar), and it contains all of my menu items...

  How do I get rid of the close button on it when it is in a window (undocked from the form)...

  There must be a way, or it is back to toolbar97 for me... ;O)

  Cheers :)

  .TiM.
LVL 1
AttarSoftwareAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BoRiSCommented:
following ;-)

I think it may be back to Toolbar97 ;-)

but you can try maybe overiding the CreateParams of the toolbar ...

Later
BoRiS
0
AttarSoftwareAuthor Commented:
Nope, fixed it...

I will leave this up for a couple of days, and then remove it, but here is your answer:

procedure TForm1.tbEndDock(Sender,Target:TObject ; X,Y:Integer);
var
  f : tCustomDockForm ;
  r : hRgn ;
begin
  if( Target is tCustomDockForm ) then
  begin
    f := tCustomDockForm( target ) ;
    SetWindowLong( f.handle,
                   GWL_STYLE,
                   GetWindowLong( f.Handle,
                                  GWL_STYLE ) and NOT WS_SYSMENU ) ;
    r := CreateRectRgn( f.left,
                        f.top,
                        f.left+f.width,
                        f.top+f.Height );
    PostMessage( f.handle, WM_NCPAINT, r, 0 ) ;
    DeleteObject( r ) ;
  end ;
end ;
0
AttarSoftwareAuthor Commented:
Sorry about that...  I didn't mean to ask a question and then answer it myself, I should have thought about it more before posting it here :'O(

I'll try harder next time...

Tim.
0
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

AttarSoftwareAuthor Commented:
PS:  BoRiS, do you want the points?  If you anser this, I'll give ya a 'D'

;OD

..TiM.
0
BoRiSCommented:
AttarSofware

Thank you for the code and the points ;-)

Later
BoRiS
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AttarSoftwareAuthor Commented:
Heh..let the handout commence... ;OD

..TiM.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.