Ticket T678128
Visible to All Users

XtraMessageBox - Auto-Close feature

created 7 years ago

I think I saw something in your documentation indicating that the MessageBox could be set to expire after a certain amount of time, making the default button the one "chosen". But I can't find anything about that now. Is that a feature or not & if so where to find out about it in the documentation. Thanks.

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

I believe you're looking for the Auto-Close Message Boxes documentation:

The Show(XtraMessageBoxArgs args)  method overload allows you to show a message box that closes automatically. The method parameter is the XtraMessageBoxArgs class object and provides the AutoCloseOptions.Delay property that allows you to set the auto-close timeout (in milliseconds).

    Comments (2)

      Brendon, I'm getting an error using the sample code in the documentation for "Auto Close" boxes. The code is:

      Visual Basic
      Dim args As New XtraMessageBoxArgs() args.AutoCloseOptions.Delay = 5000 args.AutoCloseOptions.ShowTimerOnDefaultButton = True args.DefaultButtonIndex = 0 args.Caption = "Auto-close message" args.Text = "This message closes automatically after 5 seconds." args.Buttons = New DialogResult() { DialogResult.OK, DialogResult.Cancel} XtraMessageBox.Show(args).ToString()

      The second and third lines show error - "AutoCloseOptions is not a member of XtraMessageBoxArgs" . Result, it won't run on my system. What now?

      B B
      Brendon Muck [DevExpress MVP] 7 years ago

        The Auto Close XtraMessageBox wasn't indtroduced until version 18.1.3. You would need to either update to this version, or you can use this solution from the DevExpress GitHub: how-to-create-a-custom-xtramessagebox-with-the-extended-functionality-t229906

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.