Practical
Learning: Creating the Application |
|
- Start Microsoft Visual Basic
and create a Windows
Application named AltairRealtors1
- To create a new form, on the main menu, click Projects -> Add Windows
Form...
- Set the Name to PropertyEditor and click Add
- Design the form as follows:
|
Control |
Text |
Name |
Other Properties |
Label |
|
Property Code: |
|
|
TextBox |
|
|
txtPropertyCode |
Modifiers: Public |
Label |
|
Status |
|
|
ComboBox |
|
|
cbxStatus |
Modifiers: Public
Items:
Sold
Available
Needs Repair |
Label |
|
|
|
|
DateTimePicker |
|
|
dtpDateListed |
Modifiers: Public
Format: Short |
Label |
|
Year Built: |
|
|
TextBox |
|
|
txtYearBuilt |
|
Label |
|
Property Type: |
|
|
ComboBox |
|
|
cbxPropertyTypes |
Modifiers: Public
Items:
Unknown
Single Family
Townhouse
Condominium |
Label |
|
Style: |
|
|
ComboBox |
|
|
cbxStyles |
Modifiers: Public
Items:
Farm
Colonial
Victorian
Contemporary |
Label |
|
Address: |
|
|
TextBox |
|
|
txtAddress |
Modifiers: Public |
Label |
|
City: |
|
|
TextBox |
|
|
txtCity |
Modifiers: Public |
Label |
|
Location: |
|
|
TextBox |
|
|
txtLocation |
Modifiers: Public |
Label |
|
State: |
|
|
ComboBox |
|
|
cbxStates |
Modifiers: Public
Items:
DC
MD
PA
VA
WV |
Label |
|
ZIP Code: |
|
|
TextBox |
|
|
txtZIPCode |
Modifiers: Public |
Label |
|
Stories |
|
|
TextBox |
|
0 |
txtStories |
Modifiers: Public |
Label |
|
Bedrooms: |
|
|
TextBox |
|
0 |
txtBedrooms |
Modifiers: Public |
Label |
|
Bathrooms: |
|
|
TextBox |
|
0.0 |
txtBathrooms |
Modifiers: Public |
Label |
|
Condition: |
|
|
ComboBox |
|
|
cbxConditions |
Modifiers: Public
Items:
Good
Excellent
Needs Repairs |
Label |
|
Market Value: |
|
|
TextBox |
|
0.00 |
txtMarketValue |
Modifiers: Public |
Label |
|
Picture Path: |
|
|
TextBox |
|
|
txtPicturePath |
Modifiers: Public
Enabled: False |
Button |
|
Select Picture... |
btnPicture |
|
PictureBox |
|
|
pbxProperty |
Modifiers: Public
SizeMode: Zoom |
Button |
|
OK |
btnOK |
DialogResult: OK |
Button |
|
Cancel |
btnCancel |
DialogResult: Cancel |
OpenFileDialog |
|
(Name): dlgPicture
Title: Select Property Picture
DefaultExt: jpg
Filter: JPEG Files (*.jpg,*.jpeg)|*.jpg|GIF Files (*.gif)|*.gif|Bitmap Files
(*.bmp)|*.bmp|PNG Files (*.png)|*.png |
|
Form |
FormBorderStyle: |
FixedDialog |
Text: |
Altair Realtors - Property Editor |
StartPosition: |
CenterScreen |
AcceptButton: |
btnOK |
CancelButton: |
btnCancel |
MaximizeBox: |
False |
MinimizeBox: |
False |
ShowInTaskBar: |
False |
- Double-click the Select Picture button and implement its event as
follows:
Private Sub btnPicture_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnPicture.Click
If dlgPicture.ShowDialog() = DialogResult.OK Then
txtPicturePath.Text = dlgPicture.FileName
pbxProperty.Image = Image.FromFile(txtPicturePath.Text)
End If
End Sub
|
- In the Solution Explorer, right-click Form1.vb and click Rename
- Type RealEstate.vb and press Enter twice (to display that form)
- From the Toolbox, add a ListView to the form
- While the new list view is still selected, in the Properties window, click
the ellipsis button of the Columns field and create the columns as follows:
(Name) |
Text |
TextAlign |
Width |
colIndex |
# |
|
40 |
colPropertyCode |
Prop Code |
Center |
65 |
colPropertyType |
Property Type |
|
80 |
colPropertyCondition |
Condition |
|
65 |
colLocation |
Location |
|
70 |
colStories |
Stories |
Right |
45 |
colBedrooms |
Bedrooms |
Right |
62 |
colBathrooms |
Bathrooms |
Right |
62 |
colMarketValue |
Market Value |
Right |
75 |
- Design the form as follows:
|
Control |
Text |
Name |
Other Properties |
ListView |
|
lvwAllocations |
View: Details
GridLines: True
FullRowSelect: True
Anchor: Top, Bottom, Left, Right |
PictureBox |
|
pbxProperty |
Anchor: Bottom, Left |
Label |
Description |
|
Anchor: Bottom, Right |
TextBox |
|
txtDescription |
Multiline: True
Anchor: Bottom, Right |
Button |
New Property... |
btnNewProperty |
Anchor: Bottom, Right |
Button |
Close |
btnClose |
Anchor: Bottom, Right |
|
- Right-click the form and click View Code
- Above the Public Class line, add the following lines
Imports System.IO
Imports System.Xml
Public Class RealEstate
End Class
|
- In the Class Name combo box, select btnNewProperty
- In the Method Name combo box, select Click and implement the event as follows:
Imports System.IO
Imports System.Xml
Public Class RealEstate
Private Sub btnNewProperty_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnNewProperty.Click
' Get a reference to the property editor
Dim Editor As PropertyEditor = New PropertyEditor
Dim Filename As String = "properties.xml"
If Editor.ShowDialog() = DialogResult.OK Then
Dim PropertyType As String, Location As String
Dim Stories As Integer, Bedrooms As Integer
Dim Bathrooms As Single
Dim MarketValue As Double
' We will need a reference to the XML document
Dim DOMProperties As XmlDocument = New XmlDocument
' Find out if the file exists already
' If it doesn't, then create it
If Not File.Exists(Filename) Then
DOMProperties.LoadXml( _
"<?xml version=""1.0"" encoding=""utf-8""?>" & _
"<Listing></Listing>")
DOMProperties.Save(Filename)
End If
' Open the XML file
DOMProperties.Load(Filename)
' Get a reference to the root node
Dim RootElement As XmlElement = DOMProperties.DocumentElement
PropertyType = Editor.cbxPropertyTypes.Text
Location = Editor.txtLocation.Text
Stories = CInt(Editor.txtStories.Text)
Bedrooms = CInt(Editor.txtBedrooms.Text)
Bathrooms = CSng(Editor.txtBathrooms.Text)
MarketValue = CDbl(Editor.txtMarketValue.Text)
' Create a node named Property
Dim PropertyElement As XmlElement = _
DOMProperties.CreateElement("Property")
' Add it to the root element
RootElement.AppendChild(PropertyElement)
' Create a node named PropertyType
PropertyElement = DOMProperties.CreateElement("PropertyType")
Dim TextProperty As XmlText = _
DOMProperties.CreateTextNode(PropertyType)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Location
PropertyElement = DOMProperties.CreateElement("Location")
TextProperty = DOMProperties.CreateTextNode(Location)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Stories
PropertyElement = DOMProperties.CreateElement("Stories")
TextProperty = DOMProperties.CreateTextNode(Stories.ToString())
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bedrooms
PropertyElement = DOMProperties.CreateElement("Bedrooms")
TextProperty = DOMProperties.CreateTextNode(Bedrooms.ToString())
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bathrooms
PropertyElement = DOMProperties.CreateElement("Bathrooms")
TextProperty = _
DOMProperties.CreateTextNode(Bathrooms.ToString("F"))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named MarketValue
PropertyElement = DOMProperties.CreateElement("MarketValue")
TextProperty = _
DOMProperties.CreateTextNode(MarketValue.ToString("F"))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Save the XML file
DOMProperties.Save(Filename)
End If
End Sub
End Class
|
- Execute the application
- Click the New Property button
- Enter the following pieces of information:
Property Type |
Single Family |
Location |
White Oak |
Stories |
2 |
Bedrooms |
3 |
Bathrooms |
2.5 |
Market Value |
465580 |
- Click OK
- Close the form and return to your programming environment
-
From the main menu of Visual Studio, open the properties.xml file from
the AltairRealtors1\AltairRealtors\bin\Debug folder:
<?xml version="1.0" encoding="utf-8"?>
<Listing>
<Property>
<PropertyType>Single Family</PropertyType>
<Location>White Oak</Location>
<Stories>2</Stories>
<Bedrooms>3</Bedrooms>
<Bathrooms>2.50</Bathrooms>
<MarketValue>365580.00</MarketValue>
</Property>
</Listing>
|
- Display the RealEstate.vb file
- To set attributes of a node, change the file as follows:
Imports System.IO
Imports System.Xml
Public Class RealEstate
Private Sub btnNewProperty_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnNewProperty.Click
' Get a reference to the property editor
Dim Editor As PropertyEditor = New PropertyEditor
Dim Filename As String = "properties.xml"
Dim RndNumber As Random = New Random
Editor.txtPropertyCode.Text = RndNumber.Next(100, 999).ToString() & _
"-" & RndNumber.Next(100, 999)
If Editor.ShowDialog() = DialogResult.OK Then
Dim PropertyCode As String
Dim PropertyType As String
Dim Location As String
Dim SaleStatus As String
Dim Stories As Integer, Bedrooms As Integer
Dim Bathrooms As Single
Dim MarketValue As Double
' We will need a reference to the XML document
Dim DOMProperties As XmlDocument = New XmlDocument
' Find out if the file exists already
' If it doesn't, then create it
If Not File.Exists(Filename) Then
DOMProperties.LoadXml( _
"<?xml version=""1.0"" encoding=""utf-8""?>" & _
"<Listing></Listing>")
DOMProperties.Save(Filename)
End If
' Open the XML file
DOMProperties.Load(Filename)
PropertyCode = Editor.txtPropertyCode.Text
SaleStatus = Editor.cbxStatus.Text
PropertyType = Editor.cbxPropertyTypes.Text
Location = Editor.txtLocation.Text
Stories = CInt(Editor.txtStories.Text)
Bedrooms = CInt(Editor.txtBedrooms.Text)
Bathrooms = CSng(Editor.txtBathrooms.Text)
MarketValue = CDbl(Editor.txtMarketValue.Text)
' Get a reference to the root element
Dim RootElement As XmlElement = DOMProperties.DocumentElement
' Create a node named Property
Dim PropertyElement As XmlElement = _
DOMProperties.CreateElement("Property")
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Code", PropertyCode)
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Status", SaleStatus)
' Add it to the root element
RootElement.AppendChild(PropertyElement)
. . . No Change
' Save the XML file
DOMProperties.Save(Filename)
End If
End Sub
End Class
|
- Execute the application
- Click the New Property button
- Enter the following pieces of information:
Status |
Sold |
Property Type |
Single Family |
Location |
Arlington Cemetery |
Stories |
3 |
Bedrooms |
5 |
Bathrooms |
3.5 |
Market Value |
675880 |
- Click OK
- Close the form and return to your programming environment
- In Visual Studio, access the properties.xml tab to see the file (the value
of the Code attribute will be different from yours):
<?xml version="1.0" encoding="utf-8"?>
<Listing>
<Property>
<PropertyType>Single Family</PropertyType>
<Location>White Oak</Location>
<Stories>2</Stories>
<Bedrooms>3</Bedrooms>
<Bathrooms>2.50</Bathrooms>
<MarketValue>365580.00</MarketValue>
</Property>
<Property Code="700-326" Status="Sold">
<PropertyType>Single Family</PropertyType>
<Location>Arlington Cemetery</Location>
<Stories>3</Stories>
<Bedrooms>5</Bedrooms>
<Bathrooms>3.50</Bathrooms>
<MarketValue>675880.00</MarketValue>
</Property>
</Listing>
|
- Display the RealEstate.vb file
- To add a few attributes, change the file as follows:
Imports System.IO
Imports System.Xml
Public Class RealEstate
Private Sub btnNewProperty_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnNewProperty.Click
' Get a reference to the property editor
Dim Editor As PropertyEditor = New PropertyEditor
' If this directory doesn't exist, create it
Directory.CreateDirectory("C:\Altair Realtors")
' This is the XML file that holds the list of proeprties
Dim Filename As String = "C:\Altair Realtors\properties.xml"
Dim RndNumber As Random = New Random
Editor.txtPropertyCode.Text = RndNumber.Next(100, 999) & _
"-" & RndNumber.Next(100, 999).ToString()
If Editor.ShowDialog() = DialogResult.OK Then
Dim PropertyCode As String, PropertyType As String
Dim Location As String, SaleStatus As String
Dim Style As String, Condition As String
Dim YearBuilt As Integer, Stories As Integer
Dim Bedrooms As Integer
Dim Bathrooms As Single
Dim MarketValue As Double
' We will need a reference to the XML document
Dim DOMProperties As XmlDocument = New XmlDocument
' Find out if the file exists already
' If it doesn't, then create it
If Not File.Exists(Filename) Then
DOMProperties.LoadXml( _
"<?xml version=""1.0"" encoding=""utf-8""?>" & _
"<Listing></Listing>")
DOMProperties.Save(Filename)
End If
' Open the XML file
DOMProperties.Load(Filename)
PropertyCode = Editor.txtPropertyCode.Text
Location = Editor.txtLocation.Text
SaleStatus = Editor.cbxStatus.Text
YearBuilt = CInt(Editor.txtYearBuilt.Text)
PropertyType = Editor.cbxPropertyTypes.Text
Style = Editor.cbxStyle.Text
Condition = Editor.cbxConditions.Text
Bedrooms = CInt(Editor.txtBedrooms.Text)
Bathrooms = CSng(Editor.txtBathrooms.Text)
MarketValue = CDbl(Editor.txtMarketValue.Text)
' Get a reference to the root element
Dim RootElement As XmlElement = DOMProperties.DocumentElement
' Create a node named Property
Dim PropertyElement As XmlElement = _
DOMProperties.CreateElement("Property")
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Code", PropertyCode)
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Status", SaleStatus)
' Add it to the root element
RootElement.AppendChild(PropertyElement)
' Create a node named Property
PropertyElement = DOMProperties.CreateElement("DateListed")
RootElement.LastChild.AppendChild(PropertyElement)
' Create an attribute for the DateListed element
Dim atrProperty As XmlAttribute = _
DOMProperties.CreateAttribute("YearBuilt")
atrProperty.Value = YearBuilt
PropertyElement.SetAttributeNode(atrProperty)
' Create a node named PropertyType
PropertyElement = DOMProperties.CreateElement("PropertyType")
Dim TextProperty As XmlText = _
DOMProperties.CreateTextNode(PropertyType)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create an attribute for the PropertyType element
atrProperty = DOMProperties.CreateAttribute("Style")
atrProperty.Value = Style
PropertyElement.SetAttributeNode(atrProperty)
' Create an attribute for the Condition element
atrProperty = DOMProperties.CreateAttribute("Condition")
atrProperty.Value = Condition
PropertyElement.SetAttributeNode(atrProperty)
' Create a node named Location
PropertyElement = DOMProperties.CreateElement("Location")
TextProperty = DOMProperties.CreateTextNode(Location)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Stories
PropertyElement = DOMProperties.CreateElement("Stories")
TextProperty = DOMProperties.CreateTextNode(Stories)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bedrooms
PropertyElement = DOMProperties.CreateElement("Bedrooms")
TextProperty = DOMProperties.CreateTextNode(Bedrooms)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bathrooms
PropertyElement = DOMProperties.CreateElement("Bathrooms")
TextProperty = _
DOMProperties.CreateTextNode(FormatNumber(Bathrooms))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named MarketValue
PropertyElement = DOMProperties.CreateElement("MarketValue")
TextProperty = _
DOMProperties.CreateTextNode(FormatNumber(MarketValue))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Save the XML file
DOMProperties.Save(Filename)
End If
End Sub
End Class
|
- Save the file
- To add a few attributes, change the file as follows:
Imports System.IO
Imports System.Xml
Public Class RealEstate
Private Sub btnNewProperty_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnNewProperty.Click
' Get a reference to the property editor
Dim Editor As PropertyEditor = New PropertyEditor
' If this directory doesn't exist, create it
Dim strDirectory As String = "C:\Altair Realtors"
Directory.CreateDirectory(strDirectory)
' This is the XML file that holds the list of proeprties
Dim Filename As String = "C:\Altair Realtors\properties.xml"
Dim RndNumber As Random = New Random
Editor.txtPropertyCode.Text = RndNumber.Next(100, 999) & _
"-" & RndNumber.Next(100, 999)
Dim strPicturePath As String
If Editor.ShowDialog() = DialogResult.OK Then
Dim PropertyCode As String, PropertyType As String
Dim Location As String, SaleStatus As String
Dim Style As String, Condition As String
Dim Address As String, City As String, State As String
Dim ZIPCode As String, Description As String
Dim DateListed As Date
Dim YearBuilt As Integer, Stories As Integer, Bedrooms As Integer
Dim Bathrooms As Single
Dim MarketValue As Double
' We will need a reference to the XML document
Dim DOMProperties As XmlDocument = New XmlDocument
' Find out if the file exists already
' If it doesn't, then create it
If Not File.Exists(Filename) Then
DOMProperties.LoadXml( _
"<?xml version=""1.0"" encoding=""utf-8""?>" & _
"<Listing></Listing>")
DOMProperties.Save(Filename)
End If
' Open the XML file
DOMProperties.Load(Filename)
PropertyCode = Editor.txtPropertyCode.Text
SaleStatus = Editor.cbxStatus.Text
DateListed = Editor.dtpDateListed.Value
YearBuilt = CInt(Editor.txtYearBuilt.Text)
PropertyType = Editor.cbxPropertyTypes.Text
Style = Editor.cbxStyle.Text
Condition = Editor.cbxConditions.Text
Location = Editor.txtLocation.Text
Address = Editor.txtAddress.Text
City = Editor.txtCity.Text
State = Editor.cbxStates.Text
ZIPCode = Editor.txtZIPCode.Text
Stories = CInt(Editor.txtStories.Text)
Bedrooms = CInt(Editor.txtBedrooms.Text)
Bathrooms = CSng(Editor.txtBathrooms.Text)
Description = Editor.txtDescription.Text
MarketValue = CDbl(Editor.txtMarketValue.Text)
strPicturePath = Editor.txtPicturePath.Text
' Get a reference to the root element
Dim RootElement As XmlElement = DOMProperties.DocumentElement
' Create a node named Property
Dim PropertyElement As XmlElement = _
DOMProperties.CreateElement("Property")
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Code", PropertyCode)
' Create an attribute for the Propety node
PropertyElement.SetAttribute("Status", SaleStatus)
' Add it to the root element
RootElement.AppendChild(PropertyElement)
' Create a node named Property
PropertyElement = DOMProperties.CreateElement("DateListed")
Dim TextProperty As XmlText = _
DOMProperties.CreateTextNode(DateListed.ToString("d"))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
RootElement.LastChild.AppendChild(PropertyElement)
' Create an attribute for the DateListed element
Dim atrProperty As XmlAttribute = _
DOMProperties.CreateAttribute("YearBuilt")
atrProperty.Value = YearBuilt
PropertyElement.SetAttributeNode(atrProperty)
' Create a node named PropertyType
PropertyElement = DOMProperties.CreateElement("PropertyType")
TextProperty = DOMProperties.CreateTextNode(PropertyType)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create an attribute for the PropertyType element
atrProperty = DOMProperties.CreateAttribute("Style")
atrProperty.Value = Style
PropertyElement.SetAttributeNode(atrProperty)
' Create an attribute for the PropertyType element
atrProperty = DOMProperties.CreateAttribute("Condition")
atrProperty.Value = Condition
PropertyElement.SetAttributeNode(atrProperty)
' Create a node named Location
PropertyElement = DOMProperties.CreateElement("Location")
TextProperty = DOMProperties.CreateTextNode(Location)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create some attributes for the Location element
atrProperty = DOMProperties.CreateAttribute("Address")
atrProperty.Value = Address
PropertyElement.Attributes.Append(atrProperty)
atrProperty = DOMProperties.CreateAttribute("City")
atrProperty.Value = City
PropertyElement.Attributes.Append(atrProperty)
atrProperty = DOMProperties.CreateAttribute("State")
atrProperty.Value = State
PropertyElement.Attributes.Append(atrProperty)
atrProperty = DOMProperties.CreateAttribute("ZIPCode")
atrProperty.Value = ZIPCode
PropertyElement.Attributes.Append(atrProperty)
' Create a node named Stories
PropertyElement = DOMProperties.CreateElement("Stories")
TextProperty = DOMProperties.CreateTextNode(Stories.ToString())
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bedrooms
PropertyElement = DOMProperties.CreateElement("Bedrooms")
TextProperty = DOMProperties.CreateTextNode(Bedrooms.ToString())
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Bathrooms
PropertyElement = DOMProperties.CreateElement("Bathrooms")
TextProperty = _
DOMProperties.CreateTextNode(FormatNumber(Bathrooms))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named MarketValue
PropertyElement = DOMProperties.CreateElement("MarketValue")
TextProperty = _
DOMProperties.CreateTextNode(FormatNumber(MarketValue))
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Create a node named Description
PropertyElement = DOMProperties.CreateElement("Description")
TextProperty = DOMProperties.CreateTextNode(Description)
RootElement.LastChild.AppendChild(PropertyElement)
RootElement.LastChild.LastChild.AppendChild(TextProperty)
' Save the XML file
DOMProperties.Save(Filename)
If strPicturePath.Length <> 0 Then
' The following code gets a reference to the picture's name
Dim flePicture As FileInfo = New FileInfo(strPicturePath)
' Then it copies it to the directory of this business
' It changes its name to be the same as the property code
flePicture.CopyTo("C:\Altair Realtors\" & _
PropertyCode & _
flePicture.Extension)
End If
ShowListing()
If lvwProperties.Items.Count > 0 Then
lvwProperties.Items(0).Selected = True
End If
End If
End Sub
Private Sub ShowListing()
End Sub
End Class
|
- Execute the application and create
a few properties
- Close the form and return to your programming environment
|
|