471,344 Members | 1,248 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

MessageBox with timer

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?

Jul 20 '08 #1
8 4110
No, but you could easily write a dialog control with identical behaviour and
a timer function included.
--
--
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.
"Elliot" <el************@hotmail.co.ukwrote in message
news:DC**********************************@microsof t.com...
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?
Jul 20 '08 #2
How to return the value(which button user clicked) to its caller?

"Bob Powell [MVP]" <bo*@spamkillerbobpowell.netwrote in message
news:1E**********************************@microsof t.com...
No, but you could easily write a dialog control with identical behaviour
and a timer function included.
--
--
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.
"Elliot" <el************@hotmail.co.ukwrote in message
news:DC**********************************@microsof t.com...
>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?
Jul 21 '08 #3
On Mon, 21 Jul 2008 10:41:24 -0700, Elliot <el************@hotmail.co.uk>
wrote:
How to return the value(which button user clicked) to its caller?
Just use the DialogResult, just as you would with any modal form.
Jul 21 '08 #4
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
Jul 21 '08 #5
On Mon, 21 Jul 2008 12:21:55 -0700, Kalpesh <sh*********@gmail.comwrote:
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?
Jul 21 '08 #6
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
Jul 22 '08 #7
On Tue, 22 Jul 2008 11:49:45 -0700, Kalpesh <sh*********@gmail.comwrote:
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.
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
Jul 22 '08 #8
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.

--
--
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.
"Kalpesh" <sh*********@gmail.comwrote in message
news:56**********************************@k37g2000 hsf.googlegroups.com...
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
Aug 16 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by L.Peter | last post: by
2 posts views Thread by ttan | last post: by
9 posts views Thread by Li Pang | last post: by
2 posts views Thread by John David Thornton | last post: by
12 posts views Thread by Gina_Marano | last post: by
8 posts views Thread by =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post: by
4 posts views Thread by =?Utf-8?B?R2lkaQ==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.