473,218 Members | 1,497 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,218 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 4249
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,...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.