473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 4259
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: L.Peter | last post by:
Dear Group, is there any way to popup a MessageBox with a default choice (say OK) then after 1 minute if user do nothing then OK is pressed? TIA L.Peter
2
by: ttan | last post by:
How do I write a Messagebox with print out the dot (...) to notify user to wait for 5 minutes before I go to next step. I want to Messagebox to print out the dot (...) every 5 second and no need...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
2
by: UJ | last post by:
I have a page with code in it to automatically refresh the page every 30 seconds. Works great. But if I do anything on the page (which resets the timer) and then it times out to refresh, I get the...
9
by: Li Pang | last post by:
How to show a messagebox and close by itself? Thanks
2
by: John David Thornton | last post by:
I've got a Windows Service class, and I put a System.Threading.Timer, and I've coded it as shown below. However, when I install the service and then start it in MMC, I get a peculiar message: ...
12
by: Gina_Marano | last post by:
I have created an array of timers (1-n). At first I just created windows form timers but I read that system timers are better for background work. The timers will just be monitoring different...
8
by: =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post by:
I have a Timer that I set to go off once a day, but it frequently fails! In order to debug I would like to be able to check, at any moment, whether the Timer is enabled and when it will next...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've 2 Forms: 1. Main Form 2. Form contiaing Timer (which shows messageBox after 1 sec). I want that The Main Form, will create the Second form, and that the timer will be activated,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.