|
-
Dec 19th, 2001, 01:27 AM
#1
Thread Starter
PowerPoster
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.
-
Dec 19th, 2001, 01:33 AM
#2
Hyperactive Member
I am not sure but can you check the windowstate property in resize event of the form and set it accordingly
-
Dec 19th, 2001, 01:34 AM
#3
Thread Starter
PowerPoster
Thxs
But that causes a jeck in the form - which doesnt look very appealing
-
Dec 19th, 2001, 01:41 AM
#4
Hyperactive Member
for that you can lock the screen first, perform the resizing and then unlock again.
this code is from www.vbworld.com
VB Code:
Usage
LockWindow(Form1.hWnd)
'Do updating here
UnloadWindow
Code
Declare Function LockWindowUpdate Lib "user32" _
(ByVal hWnd As Long) As Long
Public Sub LockWindow(hWnd As Long)
LockWindowUpdate hWnd
End Sub
Public Sub UnlockWindow()
LockWindowUpdate 0
End Sub
-
Dec 19th, 2001, 01:57 AM
#5
Thread Starter
PowerPoster
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
-
Dec 19th, 2001, 02:08 AM
#6
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|