Results 1 to 5 of 5

Thread: [RESOLVED] how to catch msgbox popup event ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2017
    Posts
    236

    Resolved [RESOLVED] how to catch msgbox popup event ?

    Hi ~ ALL

    My App use many msgbox in many place ( in vb class )

    when msgbox popup , Form maybe minimize in windows taskbar

    I can not see the popup of msgbox

    how to auto let Form maximize when msgbox popup

    ( how to catch msgbox popup event )
    Last edited by quickbbbb; Sep 24th, 2020 at 02:41 AM.

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: how to catch msgbox popup event ?

    I assume you have code in each form to show the msgbox?

    Then start with something basic like:
    Code:
    If Me.WindowState = vbMinimized Then Me.WindowState = vbNormal
    MsgBox ...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2017
    Posts
    236

    Re: how to catch msgbox popup event ?

    I know your methode

    But .... It is not good idea

    because

    (1)

    in vb class use "If Form1.WindowState = vbMinimized Then Me.WindowState = vbNormal"

    is not good idea

    (2)
    My App use many msgbox in many place

    I will add very many code of "If Form1.WindowState = vbMinimized Then Me.WindowState = vbNormal"

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: how to catch msgbox popup event ?

    Replace calls to MsgBox with calls to custom MyMsgBox function or yours.

    In MyMsgBox first check ActiveForm is not Nothing and ActiveForm.WindowState being vbMinimized and if needed restore form with ActiveForm.WindowState = vbNormal before calling original MsgBox.

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2017
    Posts
    236

    Re: how to catch msgbox popup event ?

    Quote Originally Posted by wqweto View Post
    replace calls to msgbox with calls to custom mymsgbox function or yours.

    In mymsgbox first check activeform is not nothing and activeform.windowstate being vbminimized and if needed restore form with activeform.windowstate = vbnormal before calling original msgbox.

    Cheers,
    </wqw>
    good !!

    thank you.

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