Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2008

Tip: Looking for answers? Try searching our database.

MessageBox with timer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elliot - 20 Jul 2008 19:20 GMT
Is it possible to show a MessageBox(Yes&No button) and assume "No" was
clicked if nothing was clicked 10 seconds after the MessageBox begins to
appear?
Bob Powell [MVP] - 20 Jul 2008 19:33 GMT
No, but you could easily write a dialog control with identical behaviour and
a timer function included.

Signature

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Is it possible to show a MessageBox(Yes&No button) and assume "No" was
> clicked if nothing was clicked 10 seconds after the MessageBox begins to
> appear?
Elliot - 21 Jul 2008 18:41 GMT
How to return the value(which button user clicked) to its caller?

> No, but you could easily write a dialog control with identical behaviour
> and a timer function included.
>
>> Is it possible to show a MessageBox(Yes&No button) and assume "No" was
>> clicked if nothing was clicked 10 seconds after the MessageBox begins to
>> appear?
Peter Duniho - 21 Jul 2008 19:26 GMT
> How to return the value(which button user clicked) to its caller?

Just use the DialogResult, just as you would with any modal form.
Kalpesh - 21 Jul 2008 20:21 GMT
Peter,

I don't have any answer on this.
However, isn't it bad that windows doesn't provide anything built-in
to do that?

Thanks
Kalpesh
Peter Duniho - 21 Jul 2008 21:40 GMT
> I don't have any answer on this.
> However, isn't it bad that windows doesn't provide anything built-in
> to do that?

To do what?  As far as I can see, every goal stated in this thread so far  
has been addressed, and not in any significantly inconvenient way.  What  
is it that you feel Windows should provide as a "built-in" solution?
Kalpesh - 22 Jul 2008 19:49 GMT
Peter,

I am not sure whether I explained myself correctly.
And the goal has been addressed in the thread.

I just wanted to say that it is bad that windows didn't provide
anything so basic that people will have to write their own custom form
for this.
Imagine windows didn't provide any api for messagebox (just an
example)

The reason I say it is bad because, windows uses it in some of its
apps already
So, can't this be provided as an API instead?

My comments are not related to your solution. This is just my view of
things

Kalpesh
Peter Duniho - 22 Jul 2008 21:58 GMT
> Peter,
>
[quoted text clipped - 4 lines]
> anything so basic that people will have to write their own custom form
> for this.

Well, I guess that's a matter of philosophical attitude.  Personally, I  
feel that simply being "so basic" isn't a sufficient condition for  
inclusion in a framework (.NET or otherwise).  It's not even a _necessary_  
condition.

The framework needs to include things that are _common_ usage.  In some  
areas, it would of course include some less-commonly-used options to allow  
customization of behavior.  But even there, I would say those options  
would generally be things that can apply more broadly (so would have more  
common usage overall) or would not otherwise be easily reproduced (so  
without which a given "commonly used" component might wind up useless).

This particular example doesn't fall into any of those categories.  It  
really is trivial to implement a timed dialog box, and it's definitely not  
something that would be commonly used (in fact, while you say "windows  
uses it in some of its apps already", I have to say that I can think of  
only one such example off the top of my head -- the "End Task" dialog --  
and there's no indication to me at all that the behavior is actually in  
the Windows API itself, rather than having been implemented as a one-time  
feature for that one dialog).

I wouldn't be so bold as to say this sort of thing would never be in .NET,  
but it's absolutely not the kind of thing that I'm surprised or  
disappointed hasn't been included in .NET so far.

Pete
Bob Powell [MVP] - 16 Aug 2008 13:42 GMT
A message box has the responsibility of alerting the user and ensuring that
they acknowledge the message.

A message that pops up and dismisses itself after a period of time is a
tooltip.

Signature

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Peter,
>
[quoted text clipped - 15 lines]
>
> Kalpesh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.