Results 1 to 2 of 2

Thread: A Problem with Form Again!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    hongkong
    Posts
    251
    Thanks marnitzg and Megatron for your useful advices.

    But still the problem is not completely solved.

    In fact I dun understand exactly what the code means:

    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

    I think it might be calling the Win32 API to set the window position. So I put it in the general declaration of the toolwindow form.

    I add the code:

    SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, &H1 Or &H2

    to the Form_Load. But the problem is :

    when I try minimize the main form several times, the toolwindow forms appear at the back of the main form again and I suspect the reason might be the toolwindow forms have already loaded but just set the invisible. So next time the main window resizes to orginal, the setwindowpos function has not been called in the Form_Load of the toolwindows forms.

    So is there any solution to this.






  2. #2
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    Code:
    SetWindowPos frmtool1.hwnd, -1, 0, 0, 0, 0, 3
    When you show the toolbar form, call this again.
    Put the declare in the main form's declarations. Then whenever you do :
    Code:
    frmtool1.show
    add the above code after it.


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