+ Reply to Thread
Results 1 to 9 of 9

prevent double click title bar

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    prevent double click title bar

    I am working on a workbook that needs to behave like an independent application (as much as possible).

    Therefore I want it to stay in FullScreen mode when a user changes the window state (minimize/normal/maximize) or when a user double-clicks the title bar.

    I have found a number of attempts online, but none of them keep the workbook permanently in Full Screen mode.

    Example file. ( https://www.nedcom.nl/fullscreen.xlsm )

    Any suggestions?
    Last edited by BartH_NL; 02-28-2023 at 05:18 PM. Reason: attached file didn't work

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: prevent double click title bar

    The simplest method may be to use the Workbook_WindowResize event,e.g. (in ThisWorkbook module)
    Please Login or Register  to view this content.
    To make the Button1_Click macro continue to act as a toggle, you need to modify it slightly:
    Please Login or Register  to view this content.
    Perhaps such a solution will suffice. But....
    When the window is in fullscreen mode, select any cell and edit it (F2 or double-click). When the cell is in edit mode, double-click on the window's title bar.
    And it's done.

    Artik

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: prevent double click title bar

    Hi Artik,

    ThnX for your suggestion. Works like a charm!
    Would be nice if we could trap the "before_change" event of the Workbook, to prevent it from going to windowState Normal at all, but this is already a hughe step forward.

    I solved this problem
    When the window is in fullscreen mode, select any cell and edit it (F2 or double-click). When the cell is in edit mode, double-click on the window's title bar.
    by protecting the worksheet and leaving all cells blocked, so no changes are possible.

    As in my application, I only allow user interaction in a series of UserForms, this is OK.
    Data is written to invisible sheets anyway.

    I think we've nailed it!

    Grtz, Bart

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: prevent double click title bar

    Since everything is happening on UserForms, why not take it a step further and hide the Excel application. Something along the lines of the code below
    Please Login or Register  to view this content.
    Although hiding and unhiding should be in a different place (perhaps opening and closing the workbook).

    Artik

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: prevent double click title bar

    Hi Artik,

    ThnX for your reply and suggestion.

    As the application has one visible sheet with an explanation and house-style branding, I have chosen to not hide the application.
    But I'll give that a go too, I could put the house-style branding and explanation in a form too.

    Grtz Bart

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: prevent double click title bar

    The attached example sets a custom background that covers the Excel application window. You can make the background partially transparent (now set to opaque). In the code you can also see how to remove the UserForm's title bar.

    Artik
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: prevent double click title bar

    ThnX Artik, I tried to run your example file, but I run into the problem that olepro32.dll is not available.
    What is that?
    And fyi, I run 64bits Excel, so I had to add PtrSafe to the declarations.
    Last edited by BartH_NL; 03-01-2023 at 11:13 AM. Reason: correction

  8. #8
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: prevent double click title bar

    Oops. I forgot to mention that the file shown earlier is only for the 32-bit version.
    Here a corrected "on knee" version that should work on 2010+ versions.

    Artik
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: prevent double click title bar

    Works great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Double Click one sheet and replicate Double Click "mark" on other sheets
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-14-2018, 08:43 AM
  2. Replies: 4
    Last Post: 07-29-2017, 09:59 AM
  3. [SOLVED] Add 1 to target on double click, add 0.5 on shift + double click
    By MarmaladeLover in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2015, 06:59 AM
  4. Double Click Excel Window Title Bar Duirng Full Screen Mode
    By Badrul Hisham in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2015, 11:50 AM
  5. Changing cell properties with double click, then revert with another double click
    By mweber2525 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-01-2014, 01:40 PM
  6. Copy double-clicked cell to next empty row in different sheet with each double-click
    By erhathaway in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-25-2013, 12:06 AM
  7. How to prevent double-click, insert a row from workbook_sheetchange
    By jeer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-09-2006, 03:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1