You can access the Application information easily as can be seen in the following lines of code
My.Application.AssemblyInfo.DirectoryPath
My.Application.AssemblyInfo.ProductName
My.Application.Log.WriteEntry(“Application Starting”, EventLogEntryType.Information, Nothing)
The above lines of code will retrieve this information from the assembly which can used by the application on run time.
properties and methods of the My.Application Object
ApplicationContext Gives access to the context associated with the current thread. AssmblyInfo Allows easy access to data from the AssemblyInfo.vb file, including CompanyName, ProductName, Title and Version. ChangeCurrentCulture Allows Change the culture in which the current thread is running, which affects such things as string manipulation and formatting ChangeCurrentUICulture Allows changing the culture that the current thread uses for retrieving culture-specific resources CommandLineArgs Return a collection of command-line arguments CurrentCulture Returns a collection of command-line arguments CurrentDirectory Returns the folder where the application resides CurrentUICulture Returns the culture that the current thread is using for retrieving culture-specific resources DoEvents Causes all messages in the message queue to be processed GetEnvironmentVariable Returns a specific environment variable on the local maching\e IsNetWorkDeployed Returns True if the application was network-deployed else returns False. Log Allows writing to application log on the local machine MainForm A read-write property that allows setting or getting the form that the application will use as its main form Run Sets up and starts the VB Startup/Shutdown Application model
SplashScreen Lets setting or getting the application's splash screen
Visual Basic has a public function MsgBox. It displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked. Public Function MsgBox( _
ByVal Prompt As Object, _
Optional ByVal Buttons As MsgBoxStyle = MsgBoxStyle.OKOnly, _
Optional ByVal Title As Object = Nothing _
) As MsgBoxResult
The MsgBoxStyle enumeration values are listed in the following table.
Enumeration | Value | Description |
OKOnly | 0 | Displays OK button only. |
OKCancel | 1 | Displays OK and Cancel buttons. |
AbortRetryIgnore | 2 | Displays Abort, Retry, and Ignore buttons. |
YesNoCancel | 3 | Displays Yes, No, and Cancel buttons. |
YesNo | 4 | Displays Yes and No buttons. |
RetryCancel | 5 | Displays Retry and Cancel buttons. |
Critical | 16 | Displays Critical Message icon. |
Question | 32 | Displays Warning Query icon. |
Exclamation | 48 | Displays Warning Message icon. |
Information | 64 | Displays Information Message icon. |
DefaultButton1 | 0 | First button is default. |
DefaultButton2 | 256 | Second button is default. |
DefaultButton3 | 512 | Third button is default. |
ApplicationModal | 0 | Application is modal. The user must respond to the message box before continuing work in the current application. |
SystemModal | 4096 | system is modal. All applications are suspended until the user responds to the message box. |
MsgBoxSetForeground | 65536 | Specifies the message box window as the foreground window. |
MsgBoxRight | 524288 | Text is right-aligned. |
MsgBoxRtlReading | 1048576 | Specifies text should appear as right-to-left reading on Hebrew and Arabic systems. |
The VB.Net framework graphically can be viewed as below:
The brief description of the various features of the dot net framework is can be considered as below:
No comments:
Post a Comment