Results 1 to 23 of 23

Thread: [RESOLVED] Modal Form in MDI

  1. #1

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Resolved [RESOLVED] Modal Form in MDI

    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)...

    Plz help me to overcome this.....

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    That is correct. I believe that if you show the form with ownership belonging to the MDI form it will work in the manner you want.

  3. #3

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    do u mean to say like this

    Code:
    frmLock.Show 1, frmMain
    i tried this too but in vein........

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Modal Form in MDI

    Quote Originally Posted by Dazzler
    do u mean to say like this

    Code:
    frmLock.Show 1, frmMain
    i tried this too but in vein........
    Try this

    frmLock.Show vbModal, frmMain
    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

  5. #5

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    Both Means the same.....


    Same problem again....

    plz someone help this is very urgent........

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Modal Form in MDI

    Hi try maximising the form frmmain in the same code followed by
    frmLock.Show vbModal, frmMain

    Would that help?
    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

  7. #7

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    sorry that is not the requirement...only when the client click open the application the form should appear in that

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Modal Form in MDI

    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

  9. #9

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    s exactly........

  10. #10
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Modal Form in MDI

    Quote Originally Posted by Dazzler
    s exactly........


    How are you calling the code? "frmLock.Show vbModal, frmMain" Can I see the calling code?

    One way i can think of doing is checking via code if frmmain is minimised. If it is, then I will call the above code in a minimised state....
    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

  11. #11

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    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

  12. #12
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Modal Form in MDI

    i will come to that later, but what about
    How are you calling the code? "frmLock.Show vbModal, frmMain" Can I see the calling code?
    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

  13. #13

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    s exactly the same way...

  14. #14

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    Hello... is anybody there to help me out........

  15. #15
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    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.

  16. #16
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    That way won't work either... Still trying.

  17. #17
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    This will work...
    Attached Files Attached Files

  18. #18

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    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....

  19. #19
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    Well, then disable the toolbar and menus on the MDI Form...

  20. #20
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    Now Try this...
    Attached Files Attached Files

  21. #21

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    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?

  22. #22
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Modal Form in MDI

    Quote Originally Posted by Dazzler
    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.

  23. #23

    Thread Starter
    Lively Member Dazzler's Avatar
    Join Date
    Sep 2007
    Posts
    68

    Re: Modal Form in MDI

    Thanks a lot... it resolved my problem.......

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