Welcome to Dream.In.Code
Getting Help is Easy!

Join 119,689 Programmers for FREE! Ask your question and get quick answers from experts. There are 2,081 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Editing the properties of your .NET application

 
Reply to this topicStart new topic

> Editing the properties of your .NET application

jacobjordan
Group Icon



post 28 Jun, 2008 - 09:37 PM
Post #1


This tutorial is aimed mainly at the people who are new to VB.NET, but anyone may be able to benefit from reading this. Also note that this tutorial was made for .NET 2005 & .NET 2008. This talks about editing the parts of your application that control the assembly info, settings, references, resources, and other application properties. First, you have to locate the page to edit them. Go to the solution explorer and click on My Project (see attached picture).
Attached Image

When you open the My Project page, you will notice there are several tabs on the left side. These tabs are

Application
Compile
Debug
References
Resources
Settings
Signing
Security
Publish

In this tutorial, we talk about the Application, Resources, References, and Settings tabs.

Application Tab

This page talks about the general properties of your application. The first one we will cover is the assembly information. The assembly information stores information about the applications purpose, creator, copyright, trademark, and version. To edit this, click on the button that says Assembly Information.... A window will show (see attached picture) where you can edit each of these properties.
Attached Image
Next, you should see a combo box with a title that says Shutdown Mode. In this, you can control weather the application will close when the startup form is closed, or when the last form closes, regardless of whether or not it is the startup form.

Below that, there is another combo box that says Splash Screen. This is fairly self-explaining. If you want your application to show a splash screen while it's starting up, set the desired form in that box.

Also on this page is where you can change the icon of your application. You should be able to find that by yourself, because it says Icon right above it. From there, you can select an icon on your computer to serve as the application's icon.

To the right of the icon menu, there is a combo box that says Application Type on it. There really shouldn't be any need to change that, because it determines what type of application you are making (console app, form app, or class library (dll)). Once you start making your application, changing that will really mess it up (in most cases).

Right below that, there is yet another combo box that says Startup Form. That controls which form will be shown when the application starts. This can be very useful if you start making your application, and suddenly realize you need a different form to start up. Instead of redesigning your entire project, you can simply change the item in that box.

(A picture of the entire Application Tab)
Attached Image

There are a few more things on that page, but we have covered most of the important things (things a beginner would probably use).

Resources Tab

Just as every individual form has it's own set of resources, your entire application has it's own set of resources as well. Adding resources should be fairly easy to figure out (if not, see attached image).
Attached Image
To access them in your code, use the namespace My.Resources. You can add almost any type of file as a resource. To access an image resource called "ImageRes", you would simply do

vb

My.Resources.ImageRes 'This returns the bitmap called "ImageRes"


Settings Tab

There will be many times you want your applications to save some of there settings on exit. To do that, you could store them in an ini file, or, a much easier way is to add a setting. Adding a setting, like adding a resource, should be fairly self-explaining (again, if not, i attached an image for that too).
Attached Image
Once you have your settings in there, they can be access in your code in the My.Settings namespace. For example, to access an integer setting called "IntSetting", this is what you would do

vb

My.Settings.IntSetting 'This returns the integer setting called "IntSetting"


Also, settings, by default, save themselves automatically when the application shuts down (this can be turned off by unchecking the Save My.Settings on Shutdown box on the Application Tab). To save them manually, do

vb

My.Settings.Save()


References Tab

This tab controls which COM or .NET dlls will be referenced by your application. It also controls the project-level imports. As you know, putting the code

vb

Imports ANamespace
' ....


will cause you to be able to access classes and objects inside that namespace without having to put the namespace name before it. If you frequently use one namespace throughout your entire application, instead of putting Imports statements at the beginning of every file, you can add a project-level import.

The references part shouldn't be hard to figure out. If there is a dll that has methods you want to use in your application, add it to the list of references (this can also be done in the Solution Explorer).
Attached Image
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 10/15/08 11:59AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month