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
Printable View
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
Load your form but do not show it until all buttons are created ...
Here is a quick sample:
VB Code:
Sub Main() Load Form1 Form1.CreateAllButtons Form1.Show 'or Visible = True End Sub
is this what you were looking for:Quote:
Originally Posted by ultra2
VB Code:
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwnd As Long) As Long LockWindowUpdate frmForm.hwnd 'Locks the Form 'Load or do what you need to do here LockWindowUpdate 0 'Unlocks the form