StrataFrame Forum

Turning off the Wait Window bell

http://forum.strataframe.net/Topic21092.aspx

By Peter Jones - 12/9/2008

Hi,

Is there any way of turning off the Wait Window beep - its drives me nuts!!

Cheers, Peter

By Edhy Rijo - 12/9/2008

Hi Peter,

I use the Wait Window control and mine does not sound any beep.

By Peter Jones - 12/9/2008

Hi Edhy,

Well that's interesting. Your comment made me think that, maybe, I was triggering something else in my environment however when I look at our library code for showing / hiding the wait window the only thing extra it does is change the form's Cursor.Current property which doesn't cause a beep.

I guess I will await SF's confirmation that the wait window doesn't beep then delve a bit deeper into my environment.

Cheers, Peter

By Edhy Rijo - 12/9/2008

Peter, this is the code I use for the wait window...

Me.Cursor = Cursors.WaitCursor

Me.WaitWindow1.Message = "Please wait, Creating Invoice Number " & Me.BizServiceCalls1.InvoiceNumber & "..."

Of course there is more code prior to ShowMessage and HideWaitwindow.

By Dustin Taylor - 12/10/2008

Nope it shouldn't be soudning a beep.

Depending on the context you are using to call it, it might cause an error or notification bell to fire. For example, if you are calling it from a combo and in the process are causing an unhandled keypress, it might beep at you.

I'd try creating a new solution call the wait window from a button on a blank form to remove everything else from the equation. If it still beeps there let us know and we'll take a closer look, but it shouldn't Smile.

By Peter Jones - 12/10/2008


Hi Dustin,

Well, here's the issue. It is definitely the WaitWindow that is causing the beep. I know this because if I remove the calls to WaitWindow it works ok. However, we call WaitWindow in utility class but, if the code is the form itself (as in Edhy's example), then no problems, e.g.

This doesn't beep:

    Private Sub PopulateGrids()

        Me.WaitWindow1.Message = "Please Wait. Refreshing Data.."

        Me.BoOTA1.RefreshBO()
        Me.BoOTY1.RefreshBO()

        Me.WaitWindow1.HideWaitWindow()

    End Sub


But this does:

    Private Sub PopulateGrids()

        clsFU.ShowTheWaitWindow(Me.WaitWindow1)

        Me.BoOTA1.RefreshBO()
        Me.BoOTY1.RefreshBO()

        clsFU.HideTheWaitWindow(Me.WaitWindow1)

    End Sub


The utility class code is:

#Region " Handle Wait Windows "

    Public Shared Sub ShowTheWaitWindow(ByVal WaitWindow As MicroFour.StrataFrame.Messaging.WaitWindow)
        ' Show we are doing something using default mesages
        ShowTheWaitWindow(WaitWindow, "PleaseWait", "RefreshingData")

    End Sub

    Public Shared Sub ShowTheWaitWindow(ByVal WaitWindow As MicroFour.StrataFrame.Messaging.WaitWindow, _
                                        ByVal WaitMessageLocKey As String, _
                                        ByVal ReasonMessageLocKey As String)
        ' Show we are doing something
        System.Windows.Forms.Cursor.Current = Cursors.WaitCursor
        Waitwindow.ShowWaitWindow(clsLOC.Localise(WaitMessageLocKey), _
                                  clsLOC.Localise(ReasonMessageLocKey), _
                                  MicroFour.StrataFrame.Messaging.MessagingCardinalPosition.Center)
    End Sub

    Public Shared Sub HideTheWaitWindow(ByVal WaitWindow As MicroFour.StrataFrame.Messaging.WaitWindow)
        ' The refresh is over - hide the wait window
        System.Windows.Forms.Cursor.Current = Cursors.Default
        Waitwindow.HideWaitWindow()
    End Sub

#End Region


We use DevExpress for our UI - could this be influencing things in anyway?

Cheers, Peter

By Edhy Rijo - 12/10/2008

Peter the problem is that your method ShowTheWaitWindow is not using the waitwindow parameter, it is calling itself "ShowTheWaitWindow" again

Public Shared Sub ShowTheWaitWindow(ByVal WaitWindow As MicroFour.StrataFrame.Messaging.WaitWindow)
        ' Show we are doing something using default mesages
        ' ShowTheWaitWindow(WaitWindow, "PleaseWait", "RefreshingData") ' This line is wrong, should be

        WaitWindow.ShowWaitWindow("PleaseWait", "RefreshingData")

End Sub

By Edhy Rijo - 12/10/2008

Please disregard my previous post, I did not notice you have an overload method.

Check the clsLOC.Localise() method to see if the beep is coming from there, test your method wihout using the clsLOC.Localise or put a break there to see where you are actually getting the beep.

By Peter Jones - 12/10/2008

Hi Edhy,

Thanks for the follow-up. Actually I did check that out and it was ok. It couldn't really be in that area as all our UI is localasied so it would have being doing a lot more than 'driving me nuts' if we had a beep every time a string was localised!

Cheers, Peter

By Trent L. Taylor - 12/11/2008

Actually, to correct the direction of this post, we actually HAVE seen instances where Windows will force a beep.  It has to do with certain environments and it is actually Windows performing the beep, not the Waitwindow.  The WaitWindow itself does not have any sound.  But under Vista, there have been several reports where the WaitWindow will sound a beep.  This has to do with focus changes and the redirection of the focus.  I experienced this once but could never reliably reproduce when I sat down on my development machine to try and determine where the sound was coming from.  Since the wait window can be shown as an independent dialog or as a child of another form, this can also have an impact.  I will try and set this up, but for the record here, the WaitWindow itself does not make a sound...it is Windows attempting to address the focus and/or the modality of the dialog.  The beep you are hearing is the same sound you would hear if you had a modal dialog up and then click outside of that dialog.
By Ivan George Borges - 12/11/2008

This might help:

http://www.vista4beginners.com/Disable-System-Beep

Couldn't test it, as my WaitWindow is behaving well.

By Trent L. Taylor - 12/11/2008

That was a good link, Ivan.  Thanks.
By Peter Jones - 12/11/2008

Thank you Gentlemen. Ivan - that was a very handy link.

Unfortunately the specific advice didn't work in my case (and I did a reboot and the beep remained disabled) but I did go into Personalise > Sounds and turned of all system sounds and that removed the wait window beep. So, it just a matter now of finding what what specific windows sound is being generated when the screen modality changes and disabling it.

So much to learn --- so little time!

Cheers, Peter

By Peter Jones - 12/12/2008

Hi Guys,

For the record - in my environment (Vista Ultimate) setting Personalise > Sound > Default Beep to None fixed the 'problem'.

Cheers, Peter

By Edhy Rijo - 12/13/2008

Hi Peter,

I am glad you found a way to sort of fix this, but there should be something deeper than that since I also have Vista Ultimate and the settings of Default Beep for me is the default one, and I have never seen the wait window causing a Beep.

By Trent L. Taylor - 12/16/2008

Edhy,

This isn't 100% in all environments.  There are a lot of factors that can come into play here, that is why I pointed out that I could not reproduce this on all machines.  But it has to do with modality and the beep outside of that dialog.  If I ever get this reproduces on my development machine I will try and come up with a workaround that doesn't involve changing anything.