' docOne.dob
Option Explicit
Private Const mstrDefaultURL = "http://www.minich.com"
Private mstrUserName As String
Public Property Get UserName() As String
UserName = mstrUserName
End Property
Private Sub chkTesting_Click()
PropertyChanged "Testing"
End Sub
Private Sub txtUserName_Change()
mstrUserName = txtUsername.Text
PropertyChanged "UserName"
End Sub
Private Sub txtNumber_Change()
PropertyChanged "NumberValue"
End Sub
Private Sub txtURL_Change()
PropertyChanged "URLEntry"
End Sub
Private Sub cmdDouble_Click()
txtNumber.Text = 2 * Val(txtNumber.Text)
End Sub
Private Sub cmdNavigate_Click()
On Error GoTo HandleNavigateErrors
Hyperlink.NavigateTo txtURL.Text
cmdNavigate_Exit:
Exit Sub
HandleNavigateErrors:
MsgBox "Invalid URL", vbOKOnly, "Hyperlink Failure"
Resume Next
End Sub
Private Sub mnuHelpAbout_Click()
frmAbout.Show vbModal
End Sub
Private Sub mnuSwitchDocTwo_Click()
If chkTesting Then
Hyperlink.NavigateTo "C:\Microsoft Visual Studio\VB98\docTwo.vbd"
Else
Hyperlink.NavigateTo App.Path & "\docTwo.vbd"
End If
End Sub
Private Sub UserDocument_Initialize()
txtURL.Text = mstrDefaultURL
Set gobjDocument = Me
End Sub
Private Sub UserDocument_ReadProperties(PropBag As PropertyBag)
txtUsername.Text = PropBag.ReadProperty("UserName", "")
txtURL.Text = PropBag.ReadProperty("URLEntry", mstrDefaultURL)
txtNumber.Text = PropBag.ReadProperty("NumberValue", "")
chkTesting.Value = PropBag.ReadProperty("Testing", False)
End Sub
Private Sub UserDocument_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "UserName", mstrUserName
PropBag.WriteProperty "URLEntry", txtURL.Text
PropBag.WriteProperty "NumberValue", txtNumber.Text
PropBag.WriteProperty "Testing", chkTesting.Value
End Sub