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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show a form but dont give it focus 1

Status
Not open for further replies.

DelphiAaron

Programmer
Jul 4, 2002
826
0
16
AU
i have a borderless form with a timer that closes it after a few seconds that i use for messages. ie RECORD SAVED, RECORD DELETED. ect...

like a messagebox without the ok button.

but when i show the message form it gets focus for the few seconds and gives it back when it closes.

is there a way to not give it focus ?

or someone may have another way to achieve this message box.

Aaron Taylor
John Mutch Electronics
 
If you set the message form style fsStayontop, then when you show the form you can set the focus back to the original form-
[blue]
FormMessage.Formstyle := fsStayontop;//if not set at design
//time
FormMessage.StaticTExt1.caption := 'The message';//etc
FormMessage.show;
Form1.setfocus;[/blue]

If this isn't what you want then let me have a bit more detail.
 
I have to chime in here with my thoughts. That sort of program design isn't very good IMHO.

Popup boxes are annoying. Ask anyone who does data entry. Every dialog box requires the user to stop working on what they're doing and pay attention to your dialog box. It's good that you don't require them to press Ok to get rid of the box, but if you don't require them to take action, then you probably shouldn't be displaying the message in a popup box.

Why don't you try adding a status bar at the bottom of the main form and having messages in there. Users who care can read it. Users who don't can ignore it and never be interrupted.
 
i agree

but a status bar message is so small and hatd to see.

i like the popup idea because its very easy to see and requires no user intervention, and doesnt interupt data entry.

Aaron Taylor
John Mutch Electronics
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top