Hi All,
My application is an MDI, i am trying to lock the system in a particular time if my system is Idle..Am using a Modal Form to get the password and open the system...
My problem is if the application is idle in minimized state,the password form appers outside the MDI application since it is not a child form(as it cannot be showed modally)...
do you mean to say that if your application is minimised and the system is idle then the form shouldn't show till the frmmain is maximised. In other words do you want to lock your application when the system is idle?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
i tried that too...i wrote code in form resize and checked that the form fires only when the state is maximized..but the case is as soon as i click the application the form is appearing before maximize...
Code:
Private Sub MDIForm_Resize()
Dim k As Long
If LockFlg = True Then
If Me.WindowState = vbMaximized Then
Call miLockWS_Click
End If
End If
End Sub
Yeah, I tried it and it does not work that way. What you are going to have to do is to create the form as a MDI Child and then when you call the form never let the form load event complete so that control never returns to the MDI Parent. That is about the only way I know to achieve what you want.
Hello..
thanks for the code... the problem with this code is i have MDI forms with menus and toolbar.. if i disable all the forms yet enable MDI form it creates problem for me as user can click open menus....
Actually while loggin into the system i will be disabling some menus based on user permissions..if i use this code i have to disable and enable all the menus.. but this creates problem as i dont know after loging in... what could be done?
but this creates problem as i dont know after loging in... what could be done?
hmmmm.... You don't know what?????
You only disable the menus when the "Modal" form is loaded which should not be all the time...
If you want to only re-enable the menus that were enabled before you disable them, you simply check and store that state of each item before disabling the menu items then only re-enable those.