+ Reply to Thread
Results 1 to 15 of 15

Screen problems with forms

  1. #1
    Registered User
    Join Date
    09-25-2007
    Posts
    20

    Screen problems with forms

    I currently have a VB macro written where under certain conditions user forms are shown for the user to select options, display messages, etc. When any of these forms are on the screen, and someone drags them, the menu image is 'dragged' across the screen. Is there a way from preventing this from happening?

    It is quite annoying and doesn't look very professional.

    Any input is greatly appreciated!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    ... the menu image is 'dragged' across the screen
    I'm missing something -- what behavior would you expect if someone drags a menu?

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You've disabled screenupdating within your code soemwhere wit

    Please Login or Register  to view this content.
    This needs re-enabling.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    It leaves ghost images of the menu on the screen as you drag.

    If you drag the menu across the screen, multiple images of the menu are shown. You can fill the screen with images of the user menu.

    Does that make more sense? Else I'll take a screenshot and upload it.

  5. #5
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    You've disabled screenupdating within your code soemwhere wit


    Code:
    Application.ScreenUpdating = False
    This needs re-enabling.
    That sounds like it could be the issue, where would I have to re-enable the screenupdating? right before the user menu is shown?

    Then disable again after hiding the form (i.e. when 'OK' is pressed) in order to cut down on screen flicker?

    My program does alot of background calculation and real-time data updates, so I've tried to limit screen flicker as much as possible as it was hurting the eyes.

    Thanks for the suggestion!

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can't say without seeing your code, but I suspect that your code is doing a lot of selecting which is probably unnecessary. By avoiding selecting you can avoid switching off screenupdating.

  7. #7
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    I don't select anything, however the program is constantly updating textbox captions to match cell values, and drawing objects become seen/hidden based on user selections.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think you will need to experiment where to switch the updating back on, as I said without the code I would only be guessing.

  9. #9
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    I used this and it worked perfectly, for anyone else who encounters this:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You don't need to switch off screen updating when loading a UserForm.

  11. #11
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    My user form shows on top of my excel sheet where inputs are entered, in order to reduce screen flicker I have screen updating turned off.

    I'm turning it back on right before displaying a user form so that if the form is dragged it doesn't leave a ghost image of the form all over the screen.

    Then, when the user is done with the user form, the screen updating is turned off again.

    it doesn't run the 'applications.screenupdating = false' until the userform is done being used.

    In my case, yes this is necessary!!

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Unless the form is shown modeless then the sheet is inaccessible. Do you mean that the form is used to work on that sheet, in which case the sheet does not really need to be visible and flickering would not be a problem.
    Last edited by royUK; 10-10-2007 at 02:37 AM.

  13. #13
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    This goes back to my original problem!

    Problem: I have a sheet where user inputs values, and in order to change selections, or to show interactive error messages, I have forms that appear. If the user drags the form, it shows ghost images across the screen.

    Solution: The 2 lines of code I added, which I included for people who experience the same problem.

    It's not the flickering that I care about when the menu is up, it's the fact that when the user form is dragged, the whole screen fills with ghost images of the form. Hence turning 'on' screenupdating right before the form is shown, then turning it back 'off' once the form is closed and when the user is working on the sheet again to reduce flicker.

    I'm not sure why you're arguing that I don't need this code. I had the problem previously, and now it is corrected. Just thought I'd share where I enabled/disabled screenupdating in relation to calling the user form to help others.

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm not arguing, you are talking about menus & forms - two different things, but carry on, it's not my problem

  15. #15
    Registered User
    Join Date
    09-25-2007
    Posts
    20
    Well, I'm using an excel userform as a menu.

    And it's not my problem either, as I've found a solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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