Hello
I'm trying to write a simple control but I'm having difficulty
assigning values from a propert sheet. The control is
simple , just a constituent Command button. When pressed
it will return a random number between a range of and High
specifed in the property sheet. I can get the Low and High
propeties to show for the control but how the heck do I
get the user modifed values. It seems that the proprty Let
, Get fired too soon.
Thanks in advance.
Anyone know of a good url for learning controls?
=======================================================
Option Explicit
Dim myRand As New clRandom
Dim m_Low As Long
Dim m_high As Long
Dim m_Bcolor As ColorConstants
Dim m_style As Integer
Public Property Get Low() As Long
Low = m_Low
End Property
Public Property Let Low(vNewlow As Long)
m_Low = vNewlow
End Property
Public Property Get High() As Long
High = m_high
End Property
Public Property Let High(vNewhigh As Long)
??? when the developer changes the property
how do I get into m_high?????
m_high = vNewhigh
End Property
Public Property Get BackColor() As ColorConstants
BackColor = m_Bcolor
End Property
Public Property Let BackColor(vNewcolor As ColorConstants)
m_Bcolor = vNewcolor
End Property
Public Property Get Style() As Integer
Style = m_style
End Property
Public Property Let Style(vNewStyle As Integer)
m_style = vNewStyle
End Property
Private Sub Command1_Click()
List1.Clear
List1.AddItem myRand.NextNumber
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
If Ambient.UserMode = True Then
Exit Sub
Else
myRand.Seed Low, High, 10
End If
End Sub