Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide tool bar (Maxmised)

Status
Not open for further replies.

Sherak

Programmer
Sep 1, 2003
83
GB
Hi,

How do I get a form to open maxmised with the windows tool bar hidden.

Thanks..
 
Are you taking about the tool bar across the bottom (usually) of the screen or the tool bar at the top of the form?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Hi James,

Sorry it the one at the bottom which continas the start button.

Thanks,
 
Fullscreen form, no taskbar.
Code:
type
  TForm1 = class( TForm )
    ...
  private
    FIsFullScreen: boolean;
    FSaveBounds:   TRect;
    ...
  end;

...

procedure TForm1.Fullscreen( b: boolean );
  begin
  if FIsFullScreen <> b
    then begin
         if b
           then begin
                FSaveBounds := BoundsRect;
                BorderStyle := bsNone;
                WindowState := wsMaximized;
                FormStyle   := fsStayOnTop
                end
           else begin
                FormStyle   := fsNormal;
                WindowState := wsNormal;
                BorderStyle := bsSizeable;
                BoundsRect  := FSaveBounds
                end;
         FIsFullScreen := b
         end
  end;

Setting the form style to "stay on top" keeps the taskbar from appearing/showing when the mouse is down at the bottom, but the user can always alt-tab to another application and then get to the taskbar. However, since your form is still "stay on top" he can't actually use any other application (except others that stay on top). Therefore, you should also adjust things when your application gains/looses focus.

I just typed all this in off the top of my head, so there might be a typo or two in there.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top