Results 1 to 3 of 3

Thread: can I suspend drawing?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    can I suspend drawing?

    I create commandbuttons in runtime, I want to suspend the form to draw itself for the while all the buttons are created.

    suspend form drawing //how to do this?

    loop ... load commandbutton(i)

    resume form drawing

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: can I suspend drawing?

    Load your form but do not show it until all buttons are created ...
    Here is a quick sample:
    VB Code:
    1. Sub Main()
    2.     Load Form1
    3.     Form1.CreateAllButtons
    4.     Form1.Show 'or Visible = True
    5. End Sub

  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: can I suspend drawing?

    Quote Originally Posted by ultra2
    I create commandbuttons in runtime, I want to suspend the form to draw itself for the while all the buttons are created.

    suspend form drawing //how to do this?

    loop ... load commandbutton(i)

    resume form drawing
    is this what you were looking for:

    VB Code:
    1. Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwnd As Long) As Long
    2.  
    3. LockWindowUpdate frmForm.hwnd 'Locks the Form
    4. 'Load or do what you need to do here
    5. LockWindowUpdate 0 'Unlocks the form
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


Posting Permissions

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



Click Here to Expand Forum to Full Width