What Caption for a MessageBox

J

James Curran

Here's a question for the group.

I am presently writing a class, which is a simple Dialog/Form. It handles a
fairly common function, so I writing it to be generic enough to be dropped
into any application. Now, here's the problem: At one point, it pops up a
MessageBox --- What should I put into the Caption of that MessageBox. The
"official" (if somewhat abandoned) standard is to put the title of the
application there. But, since this is going to be a library form, I don't
know the application title. I could use Application.ProductName (and
currently that's what I am doing), but that depends on the use actually
filling in that attribute in the AssemblyInfo.cs file. Alternately, I
could use the AssemblyTitle which has a slightly better chance of being
filled in, but is a real B!+©# to get at in .Net v1.1 (It's much easier in
v2.0, but we haven't migrated yet).

Any suggestions?
 
B

Benny Raymond

I would make it standard to pass in the name of the program or something
when creating the library, then store this as a library global variable.
 
G

Guest

I would setup a variable so that the caller can set the messageBox caption,
but default it to the application name. You could get the application name
with the following call:

Assembly.GetExecutingAssembly().GetName().Name;

-- Mikeq
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top