Results 1 to 6 of 6

Thread: MDIform

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    MDIform

    How do I stop the user from double-clicking the title bar of the MDIform and changing it to restore mode.

    I have Used some API's (Copied it from somewhere - my knowledge of API's = NILL) to disable the restore/max button of the MDI form.

    I open the MDI form in VbMaximised mode and want it that it shd remain either MAXimised or minismised but NOT in the "restored"
    position.

  2. #2
    Hyperactive Member abhid's Avatar
    Join Date
    Nov 2001
    Location
    3rd rock from the sun
    Posts
    467
    I am not sure but can you check the windowstate property in resize event of the form and set it accordingly

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Thxs

    But that causes a jeck in the form - which doesnt look very appealing

  4. #4
    Hyperactive Member abhid's Avatar
    Join Date
    Nov 2001
    Location
    3rd rock from the sun
    Posts
    467
    for that you can lock the screen first, perform the resizing and then unlock again.

    this code is from www.vbworld.com
    VB Code:
    1. Usage
    2.  
    3. LockWindow(Form1.hWnd)
    4.  
    5. 'Do updating here
    6.  
    7. UnloadWindow
    8. Code
    9.  
    10. Declare Function LockWindowUpdate Lib "user32" _
    11.     (ByVal hWnd As Long) As Long
    12.  
    13. Public Sub LockWindow(hWnd As Long)
    14.     LockWindowUpdate hWnd
    15. End Sub
    16.  
    17. Public Sub UnlockWindow()
    18.     LockWindowUpdate 0
    19. End Sub

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Unhappy

    I put your functions :

    in the mdiform1 resize event but still it becomes smaller and becomes max again - which actually would happen without the API.

    Perphaps I am not using it correctly ,Pls tell me how to use it

    Thanks

  6. #6
    Hyperactive Member abhid's Avatar
    Join Date
    Nov 2001
    Location
    3rd rock from the sun
    Posts
    467
    i just checked the function.
    resize event occurs after the resizing form. that is why it is getting minimized.
    screen should be locked before getting minimized.
    i think you should lock the screen as soon as it is displayed. and then detect any mouseevents to do rest of work i.e unlock it after performing some updation...If this is okay with application of your form.

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