Possible Duplicate:
Duplicating components at Run-Time
I have a TMyControl
(Control1
) with it's own properties/events.
How can I create a duplicate instanse Control2
that will have exactly the same properties/events?
To be more specific, I would like to clone an existing TADODataSet
with streaming fields (and some events):
object ADODataSet1: TADODataSet
Connection = ADOConnection1
CursorType = ctStatic
AfterOpen = ADODataSet1AfterOpen
CommandText = 'select top 10 * from Polls'
Parameters = <>
Left = 224
Top = 40
object ADODataSet1PollID: TGuidField
FieldName = 'PollID'
FixedChar = True
Size = 38
end
object ADODataSet1Title: TWideStringField
FieldName = 'Title'
Size = 255
end
object ADODataSet1Description: TWideStringField
FieldName = 'Description'
Size = 4000
end
object ADODataSet1PollType: TIntegerField
FieldName = 'PollType'
end
end
Since you closed this question, will you consider a duplicate if I ask a new question "How to duplicate a TADODataSet
with Persistent fields"?