I didn't say that leaving it blank was the way to go. What I said was that
99% of the time I want to put application specific data into the caption and
so, I wouldn't want the application name there. IMHO, leaving it blank it
MS's way of leaving the door open for the developer to put whatever they
want there without forcing something (the generic application title) that
you probably don't want.
I get the impression that the 2 overloads of the MessageBox.Show method that
do not take a caption parameter have been provided so that we developers can
display a 'quick and dirty' message dialog when debugging without the need
to satisfy various other parameters of the other overloads of the method.
That is certainly the only situation where I use either of those 2
overloads.
Note also that with those 2 overloads, the dialog does not display an icon.
It would be very rare that I use MessageBox.Show, (except when
debugging/troubleshooting), without specifying an icon and therefore I must
supply a value for caption. (Certainly, I could supply an empty string to
get a blank title bar if I wanted that, but I can't think of a situation
where I would want to.)
>I didn't say that leaving it blank was the way to go. What I said was that
>99% of the time I want to put application specific data into the caption
[quoted text clipped - 12 lines]
>> leaving it blank is IMO a bad idea in general. Personally I do not see
>> any reason for using a blank title bar text.
wizofaus@hotmail.com - 30 Dec 2006 22:59 GMT
> I get the impression that the 2 overloads of the MessageBox.Show method that
> do not take a caption parameter have been provided so that we developers can
[quoted text clipped - 9 lines]
> get a blank title bar if I wanted that, but I can't think of a situation
> where I would want to.)
I agree - in fact I think it should use a default "error" icon too,
which is what MFC does.
It may be intended as a "quick and dirty" method, but I see no reason
why it can't assume some sensible defaults that will actually allow it
to be of real use in a genuine app (my application in this case is an
in-house license key generator, so I don't care too much, but a message
box with no title looks like some weird resource problem to me).
Stephany Young - 30 Dec 2006 23:09 GMT
But my whole point is that it is behaving 'sensibly'.
If I use either of those 2 overloads I don't want the framework
second-guessing me.
You may not care what your applications look like (even if they are only for
in-house use) but I sure as hell do!
>> I get the impression that the 2 overloads of the MessageBox.Show method
>> that
[quoted text clipped - 22 lines]
> in-house license key generator, so I don't care too much, but a message
> box with no title looks like some weird resource problem to me).