473,748 Members | 7,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What Caption for a MessageBox

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.Pro ductName (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?

--
Truth,
James Curran [erstwhile-MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Nov 20 '05 #1
2 1732
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.

James Curran wrote:
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.Pro ductName (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?

Nov 20 '05 #2
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.GetExe cutingAssembly( ).GetName().Nam e;

-- Mikeq
"Benny Raymond" wrote:
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.

James Curran wrote:
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.Pro ductName (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?

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3482
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing appeared on my news server, so I'm trying again - this time posting a separate copy of the message to each group. I'm thinking this should be fairly easy to accomplish - a quick and dirty ... what? ... script? program?
8
3947
by: Wally | last post by:
I would like to have an image with a caption displayed below it. The size of the image will vary. The caption should not extend beyond the width of the image. How can I cause the text of the caption to wrap so that it will stay within the (varying) width of the image? Any ideas?
8
1838
by: Brian Basquille | last post by:
Hello all, Bit of a change of pace now. As opposed to the typical questions regarding my Air Hockey game, am also working on a Photo Album which uses an Access Database to store information about photos. This information is held inside the database (photoDB.mdb) in a table called 'photos' - information being recorded in there are photo information (photoID, location, phDate, category, caption). I have inputted my own photos (not via...
0
3049
by: Chenghui Li | last post by:
We have a problem with the Windows XP theme: We have a IDE which allows other developers to develop visual programs for their customers. Our IDE allow them to set font for window captions easyly (through a dialog). It works fine fo W98, 2000, NT, and XP is the theme is Classic. But on XP if the theme is "Windows XP", the we have a problem: if the developer set the caption font to be say, "Script" (and all non-default font), then the...
2
1122
by: Wayne Wengert | last post by:
I have an aspx page (built in WebMatrix) with the code shown below but when I run it if gives an error "Expression Expected" pointing to the first DB call. It is as if the calls to the DB values - "<%#Container..." are not understood? This really did run last year (we on on a new ISP now but I don't see that as causing a problem?) Any suggestions are most welcome. ============= Code ==================
7
1594
by: Wally | last post by:
Hi all. Is there a way to retrieve captions of system buttons (i.e: Ok, Yes, No, Cancel, Abort, Retry, Ignore that, for italian o.s. are Ok, Si, No, Annulla, Esci, Riprova, Ignora)? Thanks in advance. W
8
1941
by: Ron Dahl | last post by:
My visual studio has been working fine for vb.net for months. Now when I add a button with the following code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MessageBox.Show("text", "caption", MessageBoxButtons.OKCancel) End Sub The word "caption" appears at the top of the messagebox, but the word "text" is not visible and the words "OK" and "Cancel" are also not visible. ...
8
152
by: Siv | last post by:
Hi, What is the best way to get the field names of a table in SQL server where you only have Windows Authentication access to a database. Previously I have used the SQLDMO object to get this, but now I do not have access to the server using an SQL Server user account and am using the Windows Authentication. Any help appreciated. Siv
1
2807
by: kshtjj | last post by:
Dim db As Database Dim rs As Recordset Dim WS As Workspace Dim Max As Long Private Sub Form_Load() Set WS = DBEngine.Workspaces(0) DbFile = (App.Path & "\Database\AddressBook.mdb") PwdString = "swordfish"
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.