Dela via


Application Page, Project Designer (Visual Basic)

Use the Application page of the Project Designer to specify a project's application settings and properties.

To access the Application page, select a project node in Solution Explorer, and then, on the Project menu, click Properties. When the Project Designer appears, click the Application tab.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

General Application Settings

The following options enable you to configure general settings for an application.

  • Assembly name
    Specifies the name of the output file that will contain the assembly manifest. If you change this property, the Output Name property will also change. You can also make this change at a command prompt by using /out (Visual Basic). For information about how to access this property programmatically, see AssemblyName.

  • Root namespace
    Specifies the base namespace for all files in the project. For example, if you set the root namespace to Project1 and you have a Class1 outside of any namespace in your code, its namespace would be Project1.Class1. If you have a Class2 in a namespace Order in code, its namespace would be Project1.Order.Class2.

    It is also possible to clear the root namespace property, which enables you to specify the namespace structure of your project manually.

    For information about how to create namespaces in your code, see Namespace Statement.

    For more information about the root namespace property, see /rootnamespace.

    For information about how to access this property programmatically, see RootNamespace.

  • Application type
    Specifies the type of application to create. In a Web Application project, this property can be set only to Class Library. For more information, see /target. For information about how to access this property programmatically, see OutputType.

  • Icon
    Sets the .ico file that you want to use as your program icon. Select <Browse...> to browse for an existing graphic. See /win32icon (or /win32icon (Import an .ico File) (C# Compiler Options)) for more information. To access this property programmatically, see ApplicationIcon.

  • Startup form / Startup object / Startup URI
    Specifies the application's startup form or entry point.

    If Enable application framework is selected (the default), this list is titled Startup form and shows only forms because the application framework supports only startup forms, not objects.

    If the project is a WPF Browser Application, this list is titled Startup URI, and the default is Page1.xaml. The Startup URI list enables you to specify the user interface resource (a XAML element) that the application displays when the application starts. For more information, see StartupUri.

    If Enable application framework is cleared, this list becomes Startup object and shows both forms and classes or modules with a Sub Main.

    Startup object defines the entry point to be called when the application loads. Generally this is set to either the main form in your application or to the Sub Main procedure that should run when the application starts. Because class libraries do not have an entry point, their only option for this property is (None). For more information, see /main. To access this property programmatically, see StartupObject.

  • Assembly Information
    Click this button to display the Assembly Information Dialog Box.

  • Enable application framework
    Specifies whether a project will use the application framework. The setting of this option affects the options available in Startup form/Startup object.

    If this check box is selected, your application uses the standard Sub Main. Selecting this check box enables the features in the Windows application framework properties section, and also requires you to select a startup form.

    If this check box is cleared, your application uses the custom Sub Main that you specified in Startup form. In this case you can specify either a startup object (a custom Sub Main in a method or a class) or a form. Also, the options in the Windows application framework properties section become unavailable.

  • View UAC Settings
    Click this button to generate and open the app.manifest file. Visual Studio uses this file to generate manifest data for the application. Then set the UAC requested execution level by modifying the <requestedExecutionLevel> tag in app.manifest as follows:

    <requestedExecutionLevel level="asInvoker" />

    ClickOnce works with a level of asInvoker or in virtualized mode (no manifest generation). To specify virtualized mode, remove the entire tag from app.manifest.

    For more information about manifest generation, see ClickOnce Deployment on Windows Vista.

Windows Application Framework Properties

The following settings are available in the Windows application framework properties section. These options are available only if the Enable application framework check box is selected. The section following this one describes Windows application framework properties settings for Windows Presentation Foundation (WPF) Applications.

  • Enable XP visual styles
    Enables or disables the Windows XP visual styles, also known as Windows XP Themes. Windows XP visual styles enable, for example, controls with rounded corners and dynamic colors. The default is enabled. For more information about using this setting, see How to: Enable Visual Styles (Visual Basic). For more information about Windows XP visual styles, see Windows XP Features and Windows Forms Controls and How to: Enable Windows XP Visual Styles.

  • Make single instance application
    Select this check box to prevent users from running multiple instances of the application. The default setting for this check box is cleared. This setting allows multiple instances of the application to be run. For more information, see How to: Specify Instancing Behavior for an Application (Visual Basic).

  • Save My.Settings on Shutdown
    Select this check box to specify that the application's My.Settings settings are saved when users shut down their computers. The default setting is enabled. If this option is disabled, you can save application settings manually by calling My.Settings.Save.

  • Authentication mode
    Select Windows (the default) to specify the use of Windows authentication to identify the currently logged-on user. You can retrieve this information at run time by using the My.User object. Select Application-defined if you will provide your own code to authenticate users instead of using the default Windows authentication methods. For more information about using this setting, see How to: Enable Custom User Authentication (Visual Basic).

  • Shutdown mode
    Select When startup form closes (the default) to specify that the application exit when the form set as the startup form closes, even if other forms are open. Select When last form closes to specify that the application exit when the last form is closed or when My.Application.Exit or the End statement is called explicitly.

    Select On explicit shutdown to specify that the application exit when you explicitly call Shutdown.

    Select On last window close to specify that the application exit when the last window closes or when you explicitly call Shutdown. This is the default setting.

    Select On main window close to specify that the application exit when the main window closes or when you explicitly call Shutdown.

    For more information about using this setting, see How to: Specify Shutdown Behavior for an Application (Visual Basic).

  • Splash screen
    Select the form that you want to use as a splash screen. You must have previously created a splash screen by using a form or a template, as described in How to: Specify a Splash Screen for an Application (Visual Basic). The default is (None).

  • View Application Events
    Click this button to display an events code file in which you can write events for the application framework events Startup, Shutdown, UnhandledException, StartupNextInstance and NetworkAvailabilityChanged. You can also override certain application framework methods. For example, you can change the display behavior of the splash screen by overriding OnInitialize.

Windows Application Framework Properties for Windows Presentation Foundation (WPF) Applications

The following settings are available in the Windows application framework properties section when the project is a Windows Presentation Foundation application. These options are available only if the Enable application framework check box is selected. The options listed in this table are available only for WPF applications or WPF browser applications. They are not available for WPF User Control or Custom Control libraries.

  • Shutdown mode
    This property is applicable only to Windows Presentation Foundation applications.

    Select On explicit shutdown to specify that the application exit when you explicitly call Shutdown.

    Select On last window close to specify that the application exit when the last window closes or when you explicitly call Shutdown. This is the default setting.

    Select On main window close to specify that the application exit when the main window closes or when you explicitly call Shutdown.

    For more information about using this setting, see Shutdown or How to: Specify Shutdown Behavior for an Application (Visual Basic).

  • Edit XAML
    Click this button to open and modify the application definition file (Application.xaml) in the XAML editor. When you click this button, Application.xaml opens at the application definition node. You might have to edit this file to perform certain tasks, such as defining resources. If the application definition file does not exist, the Project Designer creates one.

  • View Application Events
    Click this button to display the Application partial class file (Application.xaml.vb) in a code editor. If the file does not exist, the Project Designer creates one with the appropriate class name and namespace.

    The Application object raises events when certain application state changes occur (for example, on application startup or shutdown). For a full list of the events that this class exposes, see Application. These events are handled in the user code section of the Application partial class.

See Also

Tasks

How to: Specify Assembly Information (Visual Basic, C#)

How to: Specify a Splash Screen for an Application (Visual Basic)

How to: Handle Application Events (Visual Basic)

How to: Change an Assembly Name (Visual Basic, C#)

How to: Change the Namespace for an Application (Visual Basic)

How to: Change the Application Type (Visual Basic, C#)

How to: Change the Startup Object for an Application (Visual Basic)

How to: Specify an Application Icon (Visual Basic, C#)

How to: Enable Visual Styles (Visual Basic)

How to: Specify Instancing Behavior for an Application (Visual Basic)

How to: Enable Custom User Authentication (Visual Basic)

How to: Specify Shutdown Behavior for an Application (Visual Basic)

Other Resources

Managing Application Properties