+ Reply to Thread
Results 1 to 8 of 8

Freeze user form while creating many dynamic controls

Hybrid View

richard.briggs Freeze user form while... 05-14-2014, 03:21 PM
Leith Ross Re: Freeze user form while... 05-14-2014, 07:24 PM
richard.briggs Re: Freeze user form while... 05-15-2014, 03:12 AM
Kyle123 Re: Freeze user form while... 05-15-2014, 03:52 AM
richard.briggs Re: Freeze user form while... 05-15-2014, 03:57 AM
romperstomper Re: Freeze user form while... 05-15-2014, 03:54 AM
richard.briggs Re: Freeze user form while... 05-15-2014, 03:57 AM
Kyle123 Re: Freeze user form while... 05-15-2014, 04:14 AM
  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Question Freeze user form while creating many dynamic controls

    Anyone know how to freeze a userform while controls are being created by the VBA?

    FreezeUserform
    CreateDynamicControls
    UnFreezeUserform

    ?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Freeze user form while creating many dynamic controls

    Hello richard.briggs,

    I have never heard the term "freeze" used with respect to a UserForm. Can you explain what you mean by "freeze"?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Freeze user form while creating many dynamic controls

    Quote Originally Posted by Leith Ross View Post
    Hello richard.briggs,

    I have never heard the term "freeze" used with respect to a UserForm. Can you explain what you mean by "freeze"?
    Hi,
    my form creates a lot of controls dynamically.

    The form flickers a little while all the controls are being 'painted'.
    The controls cannot be created in the initialise event as the number of controls depends on user selection of some criteria. It fear it could be more noticeable on a lower spec machine.

    Therefore I am wanting to 'freeze' or stop output to the form until the routine has finished drawing the controls, then 'unfreeze' to show all the controls without flicker.

    I have 'kind of' solved it in that I now make the parent frame invisible at the start then visible at the end, but still I have another use for freeze if you might know of a way.

    Cheers

    Richard

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Freeze user form while creating many dynamic controls

    How many controls? I've added a lot of controls to a form before and never noticed it, though I suspect that it is possible. Is your code doing anything that may slow down the adding of them inadvertently? Can you post you code?

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Freeze user form while creating many dynamic controls

    Quote Originally Posted by Kyle123 View Post
    How many controls? I've added a lot of controls to a form before and never noticed it, though I suspect that it is possible. Is your code doing anything that may slow down the adding of them inadvertently? Can you post you code?
    Could be 1000's
    www.leansoftware.net

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Freeze user form while creating many dynamic controls

    You could try the LockWindowUpdate API function.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    Leeds, United Kingdom
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    40

    Re: Freeze user form while creating many dynamic controls

    Quote Originally Posted by romperstomper View Post
    You could try the LockWindowUpdate API function.
    Thats sounds like what I am after

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Freeze user form while creating many dynamic controls

    Sounds like you need a better solution, I'd rethink my design - can you post your workbook?

+ 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. User Form Controls Vanished - Help?
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2016, 12:08 AM
  2. How yo add fancy controls to user form
    By sabhay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2012, 02:38 PM
  3. Replies: 0
    Last Post: 06-21-2012, 02:24 PM
  4. Adding controls to user form
    By toocold in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2009, 04:42 AM
  5. Creating a User Form with variable number of Controls buttons
    By Eduard in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-08-2008, 06:01 AM

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