VB Msg Box

Hi there all
I am trying to make a message box appear on the screen for a second or two but I don't want the user to have to Click on it to acknowledge it's there so the standard vbOKonly vbOKCancel buttons are no use. I just want the computer operator to be aware that the file has finished calculating without having to click OK 20 times a day. Any suggestions other than vbMsgBox?
Thanks
Lisa

Comments

  • : Hi there all
    : I am trying to make a message box appear on the screen for a second
    : or two but I don't want the user to have to Click on it to
    : acknowledge it's there so the standard vbOKonly vbOKCancel buttons
    : are no use. I just want the computer operator to be aware that the
    : file has finished calculating without having to click OK 20 times a
    : day. Any suggestions other than vbMsgBox?
    : Thanks
    : Lisa
    :

    Yeah, make a form to match the messagebox, then invoke it using [italic]Form[/italic].Show vbModal.
    This will yield execution to that form until it returns: hides or unloads.

    This code assumes:
    1) That your message box form is named frmMessageBox
    2) That is has a label lblInfo which is the caption of the messagebox
    3) That it has a timer control on it named timDelay which, when it triggers, will unload the form

    You'll have to program/fiddle around with the form a bit. The coding is very easy, it's more graphical tweaking.

    The code for using it is given by:
    [code]
    Dim fMsgBox As frmMessageBox

    fMsgBox = New frmMessageBox
    fMsgBox.lblInfo.Caption = "This is a manually created messagebox"
    [color=Green]'Oh darn... forgot what property is used by the Timer control
    ' to determine the interval between timer events[/color]
    fMsgBox.timDelay.[italic]Interval[/italic] = 2000 [color=Green]'2 seconds[/color]

    fMsgBox.Show vbModal
    Set fMsgBox = Nothing
    [/code]

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • Thanks Richard. I hadn't thought of a useform. I've just created a useform with text that says "Data has been saved" with an application delay of 3 seconds
    Private Sub UserForm_Activate()
    Application.Wait Now + TimeValue("00:00:03")
    Userform1.Hide
    End Sub
    So simple yet effective.
    Thanks again :)
  • : Thanks Richard. I hadn't thought of a useform. I've just created a
    : useform with text that says "Data has been saved" with an
    : application delay of 3 seconds
    : Private Sub UserForm_Activate()
    : Application.Wait Now + TimeValue("00:00:03")
    : Userform1.Hide
    : End Sub
    : So simple yet effective.
    : Thanks again :)
    :

    Ahhh.... using VB.NET :) Right, then it is indeed simpeler ^^

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories