Wrox Programmer Forums
|
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2006, 02:09 PM
Registered User
 
Join Date: Oct 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Messagebox.show type functionality

Hi,
I've been searching for hours now and can't seem to find out how to create a messagebox type display with no buttons. I just want to display a message box saying "Now Printing" for 3 seconds and then have it disappear. Does anyone know how to do this?
Thanks so much!
pamskate5

 
Old December 5th, 2006, 10:48 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

The MessageBox class won't display a message without a button. That's for the best anyway because it's modal so the program can't take action to close it and the message box would just sit there locking the application forever.

Probably the easiest thing to do is to make a new form. Give it a Timer that closes the form after 3 seconds and display it using Show. You can make it topmost if you want. You might also want to make it non-resizable and centered on the screen.

Rod


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old December 5th, 2006, 12:41 PM
Registered User
 
Join Date: Oct 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rod,
    Thanks for the advice... it did the trick! I added a windows form called flash_message, added a label field and added a timer control and changed the interval property to 3000 for 3 seconds and added the code below.

Private Sub Flash_Message_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Text = "Now Printing... Please Wait!"
        Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer1.Enabled = False
        Me.Close()
    End Sub

Thanks,
pamskate5






Similar Threads
Thread Thread Starter Forum Replies Last Post
messagebox.show bikki_suresh ASP.NET 1.0 and 1.1 Basics 3 March 20th, 2008 04:26 AM
Using messagebox.show() leion General .NET 17 March 20th, 2008 01:39 AM
MessageBox.Show() jyoti_khera General .NET 2 November 23rd, 2004 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.