Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Resizing a userform as large as possible (97 SR-2)

    I'm showing a userform (called PreviewForm in the code) which I would like to resize so that it takes up as much of the screen as possible (yes, size does matter). I came up with the following code:

    Application.DisplayFullScreen = True
    PreviewForm.Width = Application.UsableWidth
    PreviewForm.Height = Application.UsableHeight
    Application.DisplayFullScreen = False

    2 questions (I know, greedy):
    1) is there a better way?
    2) any ideas on why switching to full screen mode programmatically would cause the computer to beep, whereas doing it manually does not?

    Thanks in anticipation

    Jon

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Resizing a userform as large as possible (97 SR-2)

    1- You might want to change your code to this to keep the screen from flashing:

    <pre> Application.ScreenUpdating = False
    Application.DisplayFullScreen = True
    PreviewForm.Width = Application.UsableWidth
    PreviewForm.Height = Application.UsableHeight
    Application.DisplayFullScreen = False
    Application.ScreenUpdating = True
    </pre>


    2- It doesn't beep on my XL97/SR2? Are you sure that is what is causing the beep?
    Legare Coleman

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Resizing a userform as large as possible (97 SR-2)

    Thanks Legare.

    I stepped through the code (which doesn't take long). It is definitely beeping on the line Application.DisplayFullScreen = True (and the line that sets it to false for that matter).

    Ok, I've worked it out. While I was typing this I ran a few tests. It turned out that the beep is the Maximize Window sound that I have defined under Sounds in control panel. If I turn that off, there is no beep. If users have sounds on, they will get beeps. Not a lot I can do about that.

    Thanks for your time.

    Jon

Posting Permissions

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