Click here to Skip to main content
15,921,276 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Writing a prog. that locks the comp. Pin
Martin Relstic8-Sep-00 10:51
Martin Relstic8-Sep-00 10:51 
GeneralRe: Writing a prog. that locks the comp. Pin
30-Dec-00 2:32
suss30-Dec-00 2:32 
GeneralRe: Writing a prog. that locks the comp. Pin
Masoud Samimi30-Dec-00 3:04
Masoud Samimi30-Dec-00 3:04 
Generali want to learn v.basic Pin
TYRO90127-Jul-00 3:50
sussTYRO90127-Jul-00 3:50 
GeneralRe: i want to learn v.basic Pin
Yankee8-Nov-00 21:25
Yankee8-Nov-00 21:25 
GeneralCreating ActiveX controls dynamically Pin
Min26-Jul-00 5:25
Min26-Jul-00 5:25 
GeneralRe: Creating ActiveX controls dynamically Pin
Jafet Sánchez18-Sep-00 11:41
Jafet Sánchez18-Sep-00 11:41 
GeneralRe: Creating ActiveX controls dynamically Pin
Ravi S.V.14-Jul-04 1:10
Ravi S.V.14-Jul-04 1:10 
Loading ActiveX controls on form dynamically at runtime is not that easy.

One way is to declare an object variable. but you cannot handle events for the controls.

Other way is to declare a variable as VBControlExtender.
u can declare this variables with events.

The procedure to use this VBControlExtender:
'place the code in form_load or form_initialize event <br />
<br />
Dim WithEvents MyCtrl As VBControlExtender 'declaration<br />
<br />
Licenses.Add "MyCombo.MCombo" 'Add the licence of the control class to the project<br />
<br />
'Add the control to the form which is the parent to the control<br />
Set MyCtrl = Me.Controls.Add("MyCombo.MCombo", "MyCtrl", Me)<br />
'Set the position of the control and make it visible<br />
With MyCtrl<br />
    .Top = 100<br />
    .Width = 100<br />
    .Height = 315<br />
    .Left = 100<br />
    .Visible = True<br />
End With


Click event of the control can implemented in this way:
Private Sub MyCtrl_ObjectEvent(Info as EventInfo)<br />
'This Info parameter consists of event name and the parameters of the event.<br />
    If Info.Name = "Click" then<br />
        'do your code<br />
    End If<br />
End Sub


that's all

Regards,
Ravi.
GeneralSplitter in an ActiveX User Control Pin
Marlex L. Ventura12-Jul-00 12:44
sussMarlex L. Ventura12-Jul-00 12:44 
GeneralMS Word/ VBA problem Pin
kulvinder2-Jul-00 18:27
kulvinder2-Jul-00 18:27 
GeneralRe: MS Word/ VBA problem Pin
Jason Fisher21-Aug-00 5:01
professionalJason Fisher21-Aug-00 5:01 
GeneralSharing a folder Pin
James Hetrick18-Jun-00 10:38
sussJames Hetrick18-Jun-00 10:38 
GeneralRe: Sharing a folder Pin
lumine30-Jul-00 18:26
lumine30-Jul-00 18:26 
GeneralChild window for Nescape.... Pin
mahima9-Jun-00 19:03
mahima9-Jun-00 19:03 
GeneralExchanging data between processes Pin
ed welch9-Jun-00 0:46
ed welch9-Jun-00 0:46 
QuestionThumbnail Control - Not displaying previews!? Pin
Aric5-Jun-00 22:40
Aric5-Jun-00 22:40 
AnswerRe: Thumbnail Control - Not displaying previews!? Pin
Frank Deo8-Jun-00 11:33
Frank Deo8-Jun-00 11:33 
GeneralRe: Thumbnail Control - Not displaying previews!? Pin
Aric12-Jun-00 23:53
Aric12-Jun-00 23:53 
GeneralMoving a run-time generated ComboBox on a form Pin
Mixaela29-May-00 6:45
Mixaela29-May-00 6:45 
GeneralRe: Moving a run-time generated ComboBox on a form Pin
Konstantin Vasserman29-May-00 10:54
Konstantin Vasserman29-May-00 10:54 
GeneralVB Copy and Paste API's Pin
Phil McGahan17-May-00 9:32
Phil McGahan17-May-00 9:32 
GeneralRe: VB Copy and Paste API's Pin
Konstantin Vasserman17-May-00 15:10
Konstantin Vasserman17-May-00 15:10 
GeneralRe: VB Copy and Paste API's Pin
Member 351720-May-00 14:14
Member 351720-May-00 14:14 
Generalinserting new record in database Pin
Craig Handyside11-May-00 16:00
sussCraig Handyside11-May-00 16:00 
GeneralRe: inserting new record in database Pin
Konstantin Vasserman13-May-00 13:46
Konstantin Vasserman13-May-00 13:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.