Private Sub btnGo_ClickByVal sender As System.Object, _ ByVal e As System.EventArgs Handles btnGo.ClickIf IsNumerictxtIncrement.Text ThentxtResults.Text = vbNullString For Counter As Int
Trang 1Private Sub btnGo_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnGo.Click
If IsNumeric(txtIncrement.Text) ThentxtResults.Text = vbNullString
For Counter As Integer = 1 To 100 Step CType(txtIncrement.Text, Integer)txtResults.Text &= vbCrLf & Counter.ToString
NextElseMessageBox.Show(“Sorry, the increment you entered is not valid.”)End If
If objPersonalDetails IsNot Nothing ThenobjPersonalDetails.ResetFields()Me.Text = “Personal Organizer”
End IfEnd Sub
Exercise 2 Solution
1. Define the event at the top of the PersonalDetails.vbcode:
Public Event ButtonClicked(ByVal iButtonType As Integer)
2. Replace the MessageBoxlines in the ButtonClickHandlerroutine to raise the event instead,including an identifier that tells the event handler routine which button was clicked:
Private Sub ButtonClickedHandler(ByVal sender As System.Object, _ByVal e As System.EventArgs)
Trang 2Dim btnSender As Button = CType(sender, Button)
If btnSender.Name = “btnSave” ThenRaiseEvent ButtonClicked(1)ElseIf btnSender.Name = “btnCancel” ThenRaiseEvent ButtonClicked(2)
End IfEnd Sub
3. Change the definition of objPersonalDetailsin the main form to include the WithEventskeyword:
Private WithEvents objPersonalDetails As PersonalDetails
4. Create an event handler to intercept the event you created:
Private Sub objPersonalDetails_ButtonClicked(ByVal iButtonType As Integer) _
Handles objPersonalDetails.ButtonClickedMessageBox.Show(“A button was clicked: “ + iButtonType.ToString)End Sub
5. Run the application and click the Save and Cancel buttons to test the process.
Chapter 7
Exercise
1. Add four more routines to the GeneralFunctions.vbmodule to perform the following functions:
a. Determine whether a specified user exists.
b. Determine whether a user’s password matches a given string
c. Create a new user record
d. Update a user record’s Last Logged In value.
These functions are needed for the next chapter, so make sure you do them all!
Exercise 1 Solution
1. To determine whether a user exists, first retrieve the POUsertable and then apply a RowFilter
to a DataViewcopy of the table If the RowFilterreturns a row for the specified UserName,then return a Truevalue to let the calling application know that it was found:
Public Function UserExists(ByVal UserName As String) As Boolean
Dim CheckUserAdapter As New _PO_DataDataSetTableAdapters.POUserTableAdapterDim CheckUserTable As New _PO_DataDataSet.POUserDataTable
CheckUserAdapter.Fill(CheckUserTable)Dim CheckUserDataView As DataView = CheckUserTable.DefaultViewCheckUserDataView.RowFilter = “Name = ‘“ + UserName + “‘“
With CheckUserDataView
If Count > 0 Then
Trang 3Return TrueElse
Return FalseEnd If
End WithEnd Function
2. This is a variation on the previous function, but this time it first finds the row in the POUsertable and then, when found, compares the Passwordfields If they match, it returns True; in allother cases, it returns False:
Public Function UserPasswordMatches(ByVal UserName As String, ByVal Password AsString) As Boolean
Dim CheckUserAdapter As New _PO_DataDataSetTableAdapters.POUserTableAdapterDim CheckUserTable As New _PO_DataDataSet.POUserDataTable
ElseReturn FalseEnd If
If UserExists(UserName) Then Return False
Dim CreateUserAdapter As New _PO_DataDataSetTableAdapters.POUserTableAdapterDim CreateUserTable As New _PO_DataDataSet.POUserDataTable
Trang 4Public Sub UpdateLastLogin(ByVal UserName As String)
Dim UpdateUserAdapter As New _PO_DataDataSetTableAdapters.POUserTableAdapterDim UpdateUserTable As New _PO_DataDataSet.POUserDataTable
UpdateUserAdapter.Fill(UpdateUserTable)Dim UpdateUserDataView As DataView = UpdateUserTable.DefaultViewUpdateUserDataView.RowFilter = “Name = ‘“ + UserName + “‘“
With UpdateUserDataView
If Count > 0 Then.Table.Rows(0).Item(“DateLastLogin”) = NowEnd If
End WithUpdateUserAdapter.Update(UpdateUserTable)
End Sub
Chapter 8
Exercises
1. Use the code snippet library to draw a pie chart on a form The pie chart snippet can be found
by selecting Creating Windows Forms Applications ➪ Drawing
2. Create a class from two partial classes whereby one defines two variables and the other bines them together
com-Exercise 1 Solution
1. Create a new Windows Forms application and add a button to the form
2. In code view, right-click in the class and select the Insert Snippet command Choose theCreating Windows Forms ➪ Drawing category and then select Draw a Pie Chart to insert the routine It requires a number of parameters that you will need to define variables for before calling it Fortunately, the snippet command also includes an additional function calledDrawPieChartHelperthat provides a basis for these required values
3. Add a Clickevent handler routine for the button and add the following code:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.ClickDrawPieChartHelper()
End Sub
4. Modify the values in the DrawPieChartHelperso that you can display it in the normal form’s size:
Public Sub DrawPieChartHelper()
Dim percents() As Integer = {10, 20, 70}
Dim colors() As Color = {Color.Red, Color.CadetBlue, Color.Khaki}
Dim graphics As Graphics = Me.CreateGraphicsDim location As Point = New Point(70, 70)Dim size As Size = New Size(200, 200)DrawPieChart(percents, colors, graphics, location, size)End Sub
Trang 55. Run the application and click the button to have a pie chart drawn on the form, as shown inFigure C-2.
Figure C-2
Exercise 2 Solution
1. Create a new Windows Forms application and add a button to the form
2. Add two class files to the application using Project ➪ Add Class In the first class file, change theclass name to MyTest, mark it as Partial, and insert the following code:
Partial Public Class MyTestPrivate mFirstNumber As IntegerPrivate mSecondNumber As Integer
Public Property FirstNumber() As IntegerGet
Return mFirstNumberEnd Get
Set(ByVal value As Integer)mFirstNumber = valueEnd Set
End PropertyPublic Property SecondNumber() As IntegerGet
Return mSecondNumberEnd Get
Set(ByVal value As Integer)mSecondNumber = valueEnd Set
End PropertyEnd Class
3. In the second class, change its name to MyTest, too, mark it as Partial, and insert the ing code:
Trang 6follow-Partial Public Class MyTest
Public Function AddNumbers() As IntegerReturn (mFirstNumber + mSecondNumber)End Function
End Class
4. In the button’s Clickevent handler, add the following code and run the application:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.ClickDim MyObject As New MyTest
With MyObject.FirstNumber = 10.SecondNumber = 23MessageBox.Show(.AddNumbers.ToString)End With
Exercise 1 Solution
1. Because you will need to receive events from the GetGiftIdeaform, you will need to changethe definition of the frmGetGiftIdeasobject so that it is accessible throughout the form’s code.This means that you will need to declare it as a module-level variable The WithEventskey-word is used to identify the object as one that can raise events that you wish to intercept:Private WithEvents frmGetGiftIdeas As GetGiftIdeas
Remember to also change the Get Gift Ideas button’s Clickevent so that the object is instantiated:frmGetGiftIdeas = New GetGiftIdeas
2. Open the GetGiftIdea.vbfile in code view and modify the Save button’s Clickevent handler
as follows:
Private Sub btnSave_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSave.ClickDim sGiftIdeasList As String = “Suggested gift ideas: “
For iCounter As Integer = 0 To clbResults.CheckedItems.Count - 1
If iCounter > 0 Then sGiftIdeasList += “, “sGiftIdeasList += clbResults.CheckedItems(iCounter).ToString
Trang 7RaiseEvent GiftIdeasSaveRequest(sGiftIdeasList)End Sub
3. Define the event at the top of the form’s code:
Public Event GiftIdeasSaveRequest(ByVal GiftIdeasList As String)
4. Return to the PersonalDetailscontrol and add a routine to handle theGiftIdeasSaveRequestevent that adds the text included in the event to the Notes field:Private Sub frmGetGiftIdeas_GiftIdeasSaveRequest(ByVal GiftIdeasList As String) _Handles frmGetGiftIdeas.GiftIdeasSaveRequest
txtNotes.Text += GiftIdeasListEnd Sub
5. Run the application to confirm that you can add multiple sets of search results to the Notes fieldwithout closing the form
2. Add two elements to the StatusStripat the bottom of the PersonalOrganizer’s main form,
a StatusLabeland a ProgressBar Keep the StatusLabelup to date with the number ofpeople currently in the database for the current user and use the progress bar to indicate howmuch of the report has been generated when it is processing the person list
Trang 8Exercise 1 Solution
1. Create an additional GenerateReportfunction in the GeneralFunctions.vbmodule Thistime, you need to include the ID of the person the user has selected Use the following code forthe routine:
Public Function GenerateReport(ByVal PersonID As Integer, _
ByVal PersonID As Interger) As StringDim GetPersonAdapter As New _PO_DataDataSetTableAdapters.PersonTableAdapterDim GetPersonTable As New _PO_DataDataSet.PersonDataTable
GetPersonAdapter.Fill(GetPersonTable)
Dim ReportString As String = vbNullStringFor Each MyRow As _PO_DataDataSet.PersonRow In _GetPersonTable.Select(“ID = “ & PersonID.ToString)With MyRow
ReportString &= “$HDG” & NameFirst.Trim & “ “ & NameLast.Trim & vbCrLfReportString &= “$HD2Contact Details” & vbCrLf
ReportString &= “Home Phone: “ & PhoneHome.Trim & vbCrLfReportString &= “Cell Phone: “ & PhoneCell.Trim & vbCrLfReportString &= “Address: “ & Address.Trim & vbCrLfReportString &= “Email: “ & EmailAddress.Trim & vbCrLfReportString &= “$HD2Other Details” & vbCrLf
ReportString &= “Birthday: “ & DateOfBirth.ToShortDateString & vbCrLfReportString &= “Favorites: “ & Favorites & vbCrLf
ReportString &= “Preferred Gift Categories: “Dim GiftString As String = vbNullString
If (.GiftCategories And 1) <> 0 Then GiftString &= “Books, “
If (.GiftCategories And 2) <> 0 Then GiftString &= “Videos, “
If (.GiftCategories And 4) <> 0 Then GiftString &= “Music, “
If (.GiftCategories And 8) <> 0 Then GiftString &= “Toys, “
If (.GiftCategories And 16) <> 0 Then GiftString &= “Video Games, “
If (.GiftCategories And 32) <> 0 Then GiftString &= “Apparel, “
If GiftString.Length > 0 Then GiftString = _GiftString.Remove(GiftString.Length - 2, 2)ReportString &= GiftString & vbCrLf
ReportString &= “$HD2Notes” & vbCrLfReportString &= Notes & vbCrLfEnd With
NextReturn ReportStringEnd Function
2. This routine introduces another flag to indicate a different formatting option —$HD2for headings This needs to be replaced in the printing process with the correct formatting options.Edit the POPrintDoc_PrintPageroutine to cater to the new type of formatting:
sub-If ReportLines(ReportCounter).Length > 4 AndAlso
ReportLines(ReportCounter).Substring(0, 4) = “$HDG” Then
ReportLines(ReportCounter) = ReportLines(ReportCounter).Substring(4)PrintFont = New Font(“Tahoma”, 18, FontStyle.Bold)
ElseIf ReportLines(ReportCounter).Length > 4 AndAlso
ReportLines(ReportCounter).Substring(0, 4) = “$HD2” Then
ReportLines(ReportCounter) = ReportLines(ReportCounter).Substring(4)PrintFont = New Font(“Tahoma”, 14, FontStyle.Bold Or FontStyle.Italic)
Trang 9ElsePrintFont = New Font(“Times New Roman”, 12)End If
3. Change the Printand PrintPreviewmenu item event handler routines so they call the priate GenerateReportfunction to create the contents of ReportString Change the
appro-PrintPreviewroutine to the following:
Private Sub printPreviewToolStripMenuItem_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles printPreviewToolStripMenuItem.ClickReportString = vbNullString
If objPersonalDetails IsNot Nothing ThenReportString = GenerateReport(mCurrentUserID, objPersonalDetails.Person.ID)ElseIf objPersonList IsNot Nothing Then
ReportString = GenerateReport(mCurrentUserID)End If
If ReportString <> vbNullString ThenTry
With prnprvDialog.Document = POPrintDoc.ShowDialog()
End WithCatch PrintPreviewException As ExceptionEnd Try
End IfEnd Sub
4. Change the Printmenu item’s routine to use the same logic as the preceding code and run theapplication
GetPersonAdapter.Fill(GetPersonTable)Return GetPersonTable.Select(“POUserID = “ & UserID.ToString).LengthEnd Function
4. Add the following line of code to the Form_Loadevent of the main form:
tsPeopleCount.Text = GetPeopleCount(mCurrentUserID).ToString & “ people”
Add the same line of code to the objPersonalDetails_ButtonClickedevent handler if theperson is successfully added to the database In addition, repeat this line of code in the Savebutton’s event handler
Trang 105. Change the GenerateReportfunction for the list of people so that it accepts an additionalparameter of a ProgressBarcontrol This enables you to reference it as you process each row
in the table and increment the Valueproperty on the ProgressBarcontrol for each row:Public Function GenerateReport(ByVal UserID As Integer, _
ByVal pnlProgress As ToolStripProgressBar) As StringDim GetPersonAdapter As New _PO_DataDataSetTableAdapters.PersonTableAdapterDim GetPersonTable As New _PO_DataDataSet.PersonDataTable
GetPersonAdapter.Fill(GetPersonTable)
Dim ReportString As String = vbNullStringFor Each MyRow As _PO_DataDataSet.PersonRow In _GetPersonTable.Select(“POUserID = “ & UserID.ToString)pnlProgress.Value += 1
With MyRowReportString &= “$HDG” & NameFirst.Trim & “ “ & NameLast.Trim & vbCrLfReportString &= “Home Phone: “ & PhoneHome.Trim & vbCrLf
ReportString &= “Email: “ & EmailAddress.Trim & vbCrLfReportString &= “Birthday: “ & DateOfBirth.ToShortDateString & vbCrLfEnd With
NextReturn ReportStringEnd Function
6. Set up the properties of the progress bar in both the Printand PrintPreviewfunctions andmodify the call to the GenerateReportfunction for the person list Set the
tsProgress.Visibleproperty to Falseonce the process has been completed Here’s thePrintPreviewfunction as an example:
Private Sub printPreviewToolStripMenuItem_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles printPreviewToolStripMenuItem.ClickWith tsProgress
.Minimum = 0.Maximum = GetPeopleCount(mCurrentUserID).Value = 0
.Visible = TrueEnd With
ReportString = vbNullString
If objPersonalDetails IsNot Nothing ThenReportString = GenerateReport(mCurrentUserID, objPersonalDetails.Person.ID)ElseIf objPersonList IsNot Nothing Then
ReportString = GenerateReport(mCurrentUserID, tsProgress)End If
If ReportString <> vbNullString ThenTry
With prnprvDialog.Document = POPrintDoc.ShowDialog()
End WithCatch PrintPreviewException As ExceptionEnd Try
End IftsProgress.Visible = FalseEnd Sub
Trang 11Public Event StepChanged(ByVal OldStep As Integer, ByVal NewStep As Integer)
2. Change the NavigateToStepsubroutine so that it raises the event to the calling application:Private Sub NavigateToStep(ByVal StepNumber)
StoreNewValues()RaiseEvent StepChanged(mCurrentStep, StepNumber)pnlControls.Controls.Clear()
mCurrentStep = StepNumberSetForm(mCurrentStep)End Sub
3. Create a ReadOnlyproperty called StepValuesthat returns the values for a specified step Thisenables the calling code to retrieve values for a step when it receives the event:
Public ReadOnly Property StepValues(ByVal StepNumber As Integer) As StringGet
Dim myXmlDocument As New XmlDocumentDim MyNavigator As XPath.XPathNavigator = myXmlDocument.CreateNavigator()Using MyWriter As XmlWriter = MyNavigator.PrependChild()
MyWriter.WriteStartElement(“StepValues”)With mSteps(StepNumber)
If Components IsNot Nothing ThenMyWriter.WriteStartElement(.Name)For iComponentCounter As Integer = 1 To _.Components.GetUpperBound(0)
MyWriter.WriteElementString( _.Components(iComponentCounter).ComponentName, _.Components(iComponentCounter).ComponentValue)Next
MyWriter.WriteEndElement()End If
End WithMyWriter.WriteEndElement()End Using
Return myXmlDocument.InnerXmlEnd Get
End Property
Trang 124. Open Form1.vbin code view and move the definition of the frmMyExportWizardobject to thetop of the class Declare the frmMyExportWizardobject WithEventsso the program can inter-cept the new event Remember to instantiate the form when the button is clicked:
Private WithEvents frmMyExportWizard As WizardBase
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.ClickfrmMyExportWizard = New WizardBase
Dim sUserExportSettings As String
Dim sWizardDefinition As String = _My.Computer.FileSystem.ReadAllText(“TheFile.xml”)
With frmMyExportWizard.WizardDefinition = sWizardDefinition.ShowDialog()
If Not Cancelled ThensUserExportSettings = WizardSettingValuesEnd If
End WithfrmMyExportWizard = NothingMsgBox(sUserExportSettings)End Sub
5. Add an event handler routine for the StepChangedevent and display the values from the oldstep in a message box to confirm that it is retrieving the data correctly:
Private Sub frmMyExportWizard_StepChanged(ByVal OldStep As Integer, ByValNewStep As Integer) Handles frmMyExportWizard.StepChanged
MsgBox(frmMyExportWizard.StepValues(OldStep))End Sub
6. Run the application and test the new features.
Exercise 2 Solution
1. Create a new Enumto specify the types of dialogs that are allowed — Open and Save:
Private Enum AllowedBrowseButtonTypes As IntegerSaveDialog = 1
OpenDialog = 2End Enum
2. Add two new properties to the WizardComponentclass One is a Boolean property that cates whether a Browse button should be shown, and the other stores what type of browse but-ton it is:
indi-Private Class WizardComponentPublic ComponentControlType As AllowedControlTypesPublic ComponentName As String
Public ComponentCaption As StringPublic ComponentValue As String
Trang 13Public ComponentAllowedValues() As StringPublic ComponentBrowseButton As BooleanPublic ComponentBrowseButtonType As AllowedBrowseButtonTypesEnd Class
3. Edit the GetComponentsroutine so that it extracts the information from two new attributes inthe XML for a given component —BrowseButtonand BrowseType These go in the SelectCase ComponentAttribute.Nameblock:
Select Case ComponentAttribute.NameCase “ControlType”
Select Case ComponentAttribute.ValueCase “RB”
.ComponentControlType = AllowedControlTypes.RadioButtonCase “TB”
.ComponentControlType = AllowedControlTypes.TextAreaCase “CB”
.ComponentControlType = AllowedControlTypes.CheckBoxCase “CM”
.ComponentControlType = AllowedControlTypes.ComboBoxEnd Select
Case “Name”
.ComponentName = ComponentAttribute.ValueCase “Caption”
.ComponentCaption = ComponentAttribute.ValueCase “BrowseButton”
.ComponentBrowseButton = TrueCase “BrowseType”
If ComponentAttribute.Value.ToLower = “save” Then.ComponentBrowseButtonType = AllowedBrowseButtonTypes.SaveDialogElseIf ComponentAttribute.Value.ToLower = “open” Then
.ComponentBrowseButtonType = AllowedBrowseButtonTypes.OpenDialogEnd If
End Select
4. Add the Browse button if there is a Text Area that has the BrowseButtonattribute set Do this
in the AddTextAreasubroutine by modifying the code that adds the TextBoxas follows Youadd the code here so you can modify the Widthproperty of the TextBoxitself to make room forthe Browse button:
With newTB.Name = “TB” + ThisWizardComponent.ComponentName.Text = ThisWizardComponent.ComponentValue.Left = newLTBTextSize.Width
If ThisWizardComponent.ComponentBrowseButton = True ThenDim newBRBrowseButton As New Button
With newBRBrowseButton.Name = “BR” & ThisWizardComponent.ComponentName.Text = “ ”
.Top = ThisControlTop.Width = 20
.Height = newTB.Height
Trang 14.Left = pnlControls.Width - (.Width + 5).Tag = ThisWizardComponent.ComponentBrowseButtonTypeAddHandler newBRBrowseButton.Click, AddressOf BrowseButtonClickEnd With
pnlControls.Controls.Add(newBRBrowseButton).Width = newBRBrowseButton.Left - (.Left + 5)Else
.Width = pnlControls.Width - LeftEnd If
.Top = ThisControlTopEnd With
5. You’ll need two Dialogcontrols added to your form Switch to the Design view of
WizardBase.vband add a SaveFileDialogcontrol named BrowseSaveDialogand anOpenFileDialogcontrol named BrowseOpenDialog
6. Return to code view and add the BrowseButtonClickroutine that is used to handle the buttonclicks:
Private Sub BrowseButtonClick(ByVal sender As System.Object, _
ByVal e As System.EventArgs)Dim CurrentButton As Button = CType(sender, Button)
‘ get the current textDim TBName As String = “TB” & CurrentButton.Name.Substring(2)Dim CurrentTB As TextBox = pnlControls.Controls(TBName)
If CurrentButton.Tag = AllowedBrowseButtonTypes.SaveDialog ThenWith BrowseSaveDialog
.FileName = CurrentTB.Text
If ShowDialog = Windows.Forms.DialogResult.OK ThenCurrentTB.Text = FileName
End IfEnd WithElseIf CurrentButton.Tag = AllowedBrowseButtonTypes.OpenDialog ThenWith BrowseOpenDialog
.FileName = CurrentTB.Text
If ShowDialog = Windows.Forms.DialogResult.OK ThenCurrentTB.Text = FileName
End IfEnd WithEnd IfEnd Sub
7. The code is now finished To test it, edit the WizardDefs.xmlfile to enable users to browse for
a file in the Filenamecomponent and run the application (see Figure C-3):
<Component ControlType=”TB” Name=”Filename” Caption=”Filename:” BrowseButton=”true”BrowseType=”save”>C:\Temp\ExportData.xml</Component>
Trang 15<xs:attribute name=”Name” type=”NameType” use=”required”/>
<xs:attribute name=”Title” type=”xs:string” use=”required”/>
<xs:attribute name=”GlobalGraphic” type=”xs:anyURI” use=”optional”/>
<xs:attribute name=”AllowFinish” type=”xs:boolean” use=”optional”/>
</xs:complexType>
<xs:complexType name=”StepType”>
<xs:sequence>
<xs:element name=”Heading” type=”HeadingType”/>
<xs:element name=”Description” type=”DescriptionType”/>
<xs:element name=”Graphic” type=”GraphicType” minOccurs=”0”/>
<xs:element name=”Component” type=”ComponentType” minOccurs=”0”
maxOccurs=”unbounded”/>
</xs:sequence>
Trang 16<xs:attribute name=”Name” type=”NameType” use=”required”/>
<xs:attribute name=”Name” type=”NameType” use=”required”/>
<xs:attribute name=”ControlType” type=”ControlTypeType” use=”required”/>
<xs:attribute name=”Caption” type=”xs:string” use=”required”/>
</xs:complexType>
<xs:complexType name=”AllowedValueType” mixed=”true”>
<xs:attribute name=”Name” type=”NameType” use=”required”/>
<xs:attribute name=”Selected” type=”xs:boolean” use=”optional”/>
Trang 17If Item(0).Item(“Password”).ToString.Trim <> vbNullString ThenDim EncryptedPassword As String = EncryptString(Password, SecretKey)
If Item(0).Item(“Password”).ToString.Trim = EncryptedPassword ThenReturn True
ElseReturn FalseEnd If
Else
If Password = vbNullString ThenReturn True
End IfEnd IfElseReturn FalseEnd If
End WithEnd Function
of a form or the wording on a button or dialog box
2. Publish the solution via Build ➪ Publish Personal Organizer.
3. When the publish is complete, run the application from the Wrox’s Starter Kit ➪ My PersonalOrganizer Start menu item After a moment, the ClickOnce background checking will informyou of a change to the application and prompt you for an update
4. Click the OK button to update the application and confirm that your changes have been applied
Trang 19* (asterisk) multiplication operator, 71
^ (caret) SendKeys method replacement
character, 150
= (equals sign) assignment operator, 71
- (minus sign) subtraction operator, 71{ } (parentheses)
event parameter delimiters, 99subroutine delimiters, 72
% (percent sign) SendKeysmethod replacementcharacter, 150
(period)method prefix, 101object suffix, 98property prefix, 18, 101+ (plus sign)
addition operator, 71
SendKeysmethod replacement character, 150
“ ” (quotation marks) XML attribute delimiters, 243/ (slash) XML closing tag prefix, 243
~ (tilde) SendKeysmethod replacement character, 150
A
AcceptButtonproperty, 162Access Point URL, 181Access, software program, 33Actions dialog box, 65Add ➪ Class, 95
Addmethod, 88, 193Add New Item dialog box, 36, 95Add New Table menu (SQL Server), 37Add Web Reference Wizard, 180, 181
control, 13, 53, 54, 257text, 56, 162
Allow Nullsproperty, 44
AllowWebBrowserDropproperty, 170, 174Amazon web service
AWSECommerceServiceobject, 185Documentation page, 184–185function, calling, 191
license agreement, 183Personal Organizer Database application,integrating with
btnGetGiftIdeas_Clicksubroutine, 189–190
btnSearch_Clicksubroutine, 191, 192, 193calling web service, 192
Cancel button, 194
Cancelledproperty, 195
CheckedListBoxcontrol, 186, 191,
193, 194, 195debugging, 213
PersonDetailscontrol setup, 185–186, 187, 189
RadioButtoncontrol setup, 186–187, 188referencing web service, 191
Save button, 195, 198
SelectedTextproperty, 192title, concatenating into string, 195registration, 183
starter kit, building application access using, 20–23Subscription ID, 183, 191