Results 1 to 6 of 6
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Removing Restore Button on Maximised Form/Report (2000 and XP)

    At times it is necessary to allow users to preview reports.
    When this is done the windows is automatically maximised during the activate event.

    The Reports have custom toolbars and menus so there is no problem with closing them.
    However, even if the control box and close, max and min buttons are set to no in the properties, the window still
    gets a restore button when it is forced to be maximized.
    If a user then presses this, they cannot make it bigger again.
    I don't want them to be able to make it bigger, but then again I don't want them to be able to restore the window to normal state either.

    Is there any way to stop this restore button from appearing on a maximised Form/Report?

    I can find no properties that do it, but I expect it is possible using an API call against the window.
    Anyone know how to do this or whi API function to use.

    I have trawled through a list of the API functions but cannot find one that appears to do it.

    I can do it in VB6 but not here.

    Any assistance greatly appreciated.
    Andrew

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Removing Restore Button on Maximised Form/Report (2000 and XP)

    OK, so I've just searched the forum and found a possible solution.
    I posted the question and then looked I know.

    However, as fine as that solution is, how come vb6 manages to perform the no restore button bit?
    Does it use the same solution of fitting the window with no title bar to the parent mdi screen?

    Anyone else got a solution?
    Andrew

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Removing Restore Button on Maximised Form/Report (2000 and XP)

    VB doesn't use the same kind of forms that Access does. All Access forms are contained within the application window. VB forms aren't. Different rules apply.
    Charlotte

  4. #4
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Removing Restore Button on Maximised Form/Report (2000 and XP)

    Yes I know.
    But... Same Company, Common OS
    VB Child Forms work within a Parent MDI forms when maximized (without the Restore button if you don't want it.)
    Would have been nice if they could keep things consistent.
    But then they never do.
    I have even discovered now that in Access XP
    If you use the API to size the window to simulate a maximized screen and remove max min and close buttons, placing the close button on
    a custom toolbar, it works fine.
    Do the same thing on a report window in preview and
    you can't close it from your toolbar button unless you let the report have a close button.
    And thts in the same product.
    ( So consistent those MS developers).
    Andrew

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Removing Restore Button on Maximised Form/Report (2000 and XP)

    We've done this with the AccessUI development tool, but it isn't a trivial thing to do, and you have to do a fair bit of extra work in order to make it behave exactly as you wish. In any event, you will always be able to do a restore on the application, unless you block that as well. Again it can be done, but we've found little benefit to doing so, and it annoys some users when you do that. FWIW.
    Wendell

  6. #6
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Removing Restore Button on Maximised Form/Report (2000 and XP)

    Thanks'
    Yes, I have a solution at the moment.
    Taken from an earier posting.
    It works best in 2002 because you can strip off more stuff before resorting to the API.
    If I use a form with NO border, custom menus and toolbars, and make sure that it has no Min,Max or Close Buttons (except rep[orts that need close)
    It works well enough for my purposes.
    Get some odd effects if the Main app window is restored and then maximized again though.

    Maybe in Access 11 eh.
    Andrew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •