Datasheet
Public Class Form1
Private m_count As Integer
Public Property Count() As Integer
Get
Return m_count
End Get
Set(ByVal value As Integer)
m_count = value
End Set
End Property
''' < summary >
'''
''' < /summary >
''' < param name="sender" > < /param >
''' < param name="e" > < /param >
''' < remarks > < /remarks >
Private Sub ButtonTest_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ButtonTest.Click
Count += 1
MessageBox.Show("Hello World shown " + Count.ToString() + " times.",
"Hello World Message Box",
MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Sub
End Class
Code snippet from Form1
This code refl ects the event handler added for the button. The code contained in the handler was already
covered, with the exception of the naming convention for event handlers. Event handlers have a naming
convention similar to that in previous versions of Visual Basic: The control name is followed by an underscore
and then the event name. The event itself may also have a standard set of parameters. At this point, you can
test the application, but to do so let ’ s fi rst look at your build options.
Building Applications
For this example, it is best to build your sample application using the Debug build confi guration. The fi rst
step is to ensure that Debug is selected as the active confi guration. As noted earlier in this chapter around
Figure 1 - 7 you ’ ll fi nd the setting available on your project properties. It ’ s also available from the main Visual
Studio display in the Solution Confi gurations drop - down list box that ’ s part of the Standard Toolbar.
Visual Studio provides an entire Build menu with the various options available for building an application.
There are essentially two options for building applications:
Build — This option uses the currently active build confi guration to build the project or solution,
depending upon what is available.
Publish — For Visual Basic developers, this option starts the process of creating a release build, but
note that it also ties in with the deployment of your application, in that you are asked to provide an
URL where the application will be published.
The Build menu supports building for either the current project or the entire solution. Thus, you can
choose to build only a single project in your solution or all of the projects that have been defi ned as part
of the current confi guration. Of course, anytime you choose to test - run your application, the compiler will
automatically perform a compilation check to ensure that you run the most recent version of your code.
You can either select Build from the menu or use the Ctrl+Shift+B keyboard combination to initiate a
build. When you build your application, the Output window along the bottom edge of the development
➤
➤
Enhancing a Sample Application
❘
45
CH001.indd 45CH001.indd 45 4/5/10 11:56:57 AM4/5/10 11:56:57 AM