Fogkch » 16.12.2005 (Пт) 12:48
Перелепил контрол, сделал без формы, но возникла другая проблема.
***** Это код контрола после легкой кастрации
******Если переменным (напротив них куча звездочек) присваиваю
конкретные значения в мраморе в том месте, где они сейчас и находятся, то
усе работает, а обратиться к свойствам контрола, как сейчас написано то
ли не получается, но он их не видит. Как к ним обратится? Переменная
ConStr объявлена в модуле.
Const m_def_Id = 1
Const m_def_GetSQLString = ""
Const m_def_ConnectString = ""
'Property Variables:
Dim m_Id As Long
Dim m_GetSQLString As String
Dim m_ConnectString As String
Event Click()
Private Sub bQBE_Click()
RaiseEvent Click
‘
‘тут всякое
‘
‘
Me.GetSQLString = crit
UserControl.Height = 0
UserControl.Width = 0
End Sub
'
Private Sub Me_InitProperties()
m_Id = m_def_Id
m_ConnectString = m_def_ConnectString
m_GetSQLString = m_def_GetSQLString
m_Enabled = m_def_Enabled
End Sub
Private Sub Me_ReadProperties(PropBag As PropertyBag)
m_Id = PropBag.ReadProperty("Id", m_def_Id)
m_ConnectString = PropBag.ReadProperty("ConnectString",
m_def_ConnectString)
m_GetSQLString = PropBag.ReadProperty("GetSQLString",
m_def_GetSQLString)
Set m_Controls = PropBag.ReadProperty("Controls", Nothing)
m_Enabled = PropBag.ReadProperty("Enabled", m_def_Enabled)
End Sub
'Write property values to storage
Private Sub Me_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Id", m_Id, m_def_Id)
Call PropBag.WriteProperty("ConnectString", m_ConnectString,
m_def_ConnectString)
Call PropBag.WriteProperty("GetSQLString", m_GetSQLString,
m_def_GetSQLString)
Call PropBag.WriteProperty("Controls", m_Controls, Nothing)
Call PropBag.WriteProperty("Enabled", m_Enabled, m_def_Enabled)
End Sub
Private Sub UserControl_Initialize()
ConStr = m_ConnectString'********************************************
Me.Id = m_Id'*********************************************************
FormMasterName = GetFormMasterName(Me.Id)
FormSlaveName = GetFormSlaveName(Me.Id)
NameSource = GetNameSource(Me.Id)
FieldsCount = Val(GetFieldsCount(Me.Id))
End Sub
'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
m_GetSQLString = m_def_GetSQLString
m_ConnectString = m_def_ConnectString
m_Id = m_def_Id
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_GetSQLString = PropBag.ReadProperty("GetSQLString",
m_def_GetSQLString)
m_ConnectString = PropBag.ReadProperty("ConnectString",
m_def_ConnectString)
m_Id = PropBag.ReadProperty("Id", m_def_Id)
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Id", m_Id, m_def_Id)
Call PropBag.WriteProperty("GetSQLString", m_GetSQLString,
m_def_GetSQLString)
Call PropBag.WriteProperty("ConnectString", m_ConnectString,
m_def_ConnectString)
Call PropBag.WriteProperty("Id", m_Id, m_def_Id)
End Sub
Public Property Get Controls() As Object
Set Controls = UserControl.Controls
End Property
Public Property Get GetSQLString() As String
GetSQLString = m_GetSQLString
End Property
Public Property Let GetSQLString(ByVal New_GetSQLString As String)
m_GetSQLString = New_GetSQLString
PropertyChanged "GetSQLString"
End Property
Public Property Get ConnectString() As String
ConnectString = m_ConnectString
End Property
Public Property Let ConnectString(ByVal New_ConnectString As String)
m_ConnectString = New_ConnectString
PropertyChanged "ConnectString"
End Property
Public Property Get Id() As Long
Id = m_Id
End Property
Public Property Let Id(ByVal New_Id As Long)
m_Id = New_Id
PropertyChanged "Id"
End Property