Thread: msgbox hiding

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    2
    Rep Power
    0

    msgbox hiding


    I have a piece of software which retrieves data from a subsea acquisition system.

    It's worked for years until recently where I've noticed that a message box seems to get lost behind a form within my application.
    The data is displayed on a form (modal) and the msgbox code is called from a module.

    Is there a way I can force the msgbox to display on top of everything?

    Or rather than call the msgbox code from a module should I create a function within the displayed form to show the msgbox?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    2
    Rep Power
    0
    Here is the code:

    Code:
    Open "C:\Test\WhatsHappening.txt" For Append As #6
    Write #6, "1"
    Close #6
    
    ' Write the instruction to the log file
    ControlLogFile ("Thrust Stopped : Maximum Tip Pressure Reached")
                                        
    Open "C:\Test\WhatsHappening.txt" For Append As #6
    Write #6, "2"
    Close #6
                                        
    ' Inform the operator
    msgbox "Thrust Stopped : Maximum tip pressure reached.", vbOKOnly Or vbExclamation, "Operator Warning"
    
                                        
    Open "C:\Test\WhatsHappening.txt" For Append As #6
    Write #6, "3"
    Close #6
    With the text file "WhatsHappening" it only gets to the number 2, never past. Very strange!
  4. #3
  5. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,436
    Rep Power
    9645
    It should be modal (displaying on top of everything) already...

    There's a nuclear option you can try: the vbSystemModal setting. It should definitely pop the msgbox on top of everything, with the downside that it's on top of everything.
    Code:
    vbOKOnly Or vbExclamation Or vbSystemModal

IMN logo majestic logo threadwatch logo seochat tools logo