Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MessageBox without an OK button 4

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
Is there a message box that doesn't need to be clicked please? I would like to give the User some brief advice, but I don't want to inconvenience him with having to click a button on it to continue.

I thought ToolTips might do it, but actually seeing it is too uncertain. A MsgBox on a 5-second timer would be ideal.
 
You can make your own by just making a new form. Call it frmMessageBox or whatever, remove all minimize/maximize/close buttons, set the Form title, leave AutoCenter on and AutoResize on, put a 5000 ms timer on it, and on Timer(), it closes the form. I'd recommend you also put an "OK" or "Continue" button, in case your users want to move on before 5 seconds. You can also do a countdown, i.e. "This will close in X seconds." - but that's all you.

But you can't do it using the MsgBox command.
 
are you familiar with vba?

You can write a short routine that calls the messagebox, then waits 5 seconds, and then send the return key to the msgbox.
 
Why don't you use a status bar to display any messages you wish?
 
Yes, familiar at a modest level, Blorf. Sounds interesting. Do you have the routine?
 
Foolio12 Yes, that's it. Perfect, thanks very much. (I can see lots of forms vanishing now.) Brilliant.
 
Blorf What I don't know is how to tell it to wait 5 seconds and then close. Be grateful for the direction, please.
 
Blorf,
Have you actually managed to code that idea? I tried something similar some time ago, but it failed. It seemed that the msgbox call halted execution of the code, so the command to close the window never got sent until after the user already closed it. If you have a solution for this, I would appreciate seeing it.

foolio12,
I tried you suggestion a while back, but I was having trouble getting it to size itself properly for longer messages. How would you suggest handling this?

Thank you for your suggestions. This is an issue I gave up on, but I've kept in the back of my mind.
 
Sorry, I am playing with it, and can not seem to make it work. Problem I am having is keeping the msgbox from making all other functions "wait"

I am currious about a solution though, so I will keep working on it.

Sorry.

 
KornGeek: I have no idea. :)

I honestly don't use this method. I don't necessarily believe in 'time-delay' messages; either the user clicks on "OK" or I put it on the same form, or I use tooltips instead (is it called ControlTips? whatever). Maybe you can emulate a bound form, set the textbox in the 'detail' section to your message, and allow the textbox to shrink. This doesn't allow for left-right adjustments, though.
 
I have posted a solution for this in the following thread:
thread705-616104
This will display a standard message box, but it will timeout after a specified interval.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
foolio12,
I agree with you about steering away from time-delay messages. However, due to customer requests, I'm sometimes asked to code things that I don't necessarily agree with.

It sounds to me like the solution might take too much effort to be worth the nominal payoff in my situation.

Thank you.
 
Gentlemen
Foolio's idea of a form instead of a message box worked well for me. The original form is too busy to hold the necessary message ... and as soon as a message is required a Foolio-like message box appears, tells it story, and then vanishes.

I understand that this sort of thing might seem a bit gimmicky, but there are places where it works well, and I'm grateful to Foolio for it. Cheers all.
 
CajunCenturion

Will try the code from your thread for the next time. It looks very interesting. Many thanks.
 
CajunCenturion,
That code looks great. I'll have to try it as soon as I'm done putting out my current fires. Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top