SDC Logo SDC Logo    
Google
Home About Us Products Information FAQ Order Downloads Contact Us
Information
  License Agreement
  Privacy
  Reseller
  Links
  Awards
Support
  Customer Services
  Consulting
  Documentation
  Tutorials
Sample Codes
  VB6 Sample Codes
  VC6 Sample Codes
  HTML Sample Codes
  VB.NET Sample Codes
  C# Sample Codes
  VC++8 Sample Codes
Knowledgebase
  OPC
  DDE
  SCADA
  COM/DCOM

Tutorials


How To Use ActiveX

How To Use Windows Form Control


How To Use ActiveX

ActiveX can be supported by many development platforms. Following lists main development platforms:

  • Microsoft Visual Basic 4.0
  • Microsoft Visual Basic 5.0 & 6.0 
  • Microsoft Visual Foxpro 3.0 and 5.0
  • Microsoft Visual Basic for Application (Word, Excel and PowerPoint)
  • Microsoft Access
  • Microsoft Visual C++ 4.x
  • Microsoft Visual C++ 5.0 & 6.0
  • Microsoft Visual Studio.NET

  • Microsoft Visual Basic 4.0

    Start your Visual Basic 4,0 and load your project or create a new project.

    1. Choose menu Tools|Custom Controls... or press Ctrl+T or right-click the Toolbox and choose Custom Controls... in the popup menu.
    2. In the Custom Controls dialog, find which control you want to use in your project from the Available Controls list.
    3. Set the check box before the controls you want then click the OK in the Custom Controls dialog.
    4. The icons of the controls you choose are showed at the end of the Toolbox. Click the icon to choose a control and insert the control into the form.

    Microsoft Visual Basic 5.0 & 6.0

    Start your Visual Basic 5.0 or 6.0 and load your project or create a new project.

    1. Choose menu Project|Components... or press Ctrl+T or right-click the Toolbox and choose Components... in the popup menu.
    2. In the Components dialog, select Controls tab, find which control you want to use in your project from the controls list.
    3. Set the check box before the controls you want then click the OK in the Components dialog.
    4. The icons of the controls you choose are showed at the end of the Toolbox. Click the icon to choose a control and insert the control into the form.

    Microsoft Visual Foxpro 3.0 and 5.0

    Start your Visual Foxpro

    1. Choose menu Tools|Options...
    2. In the Options dialog, select Controls tab and select the OLE Controls radio button and the Controls check box.
    3. Find which control you want to use in your project from the controls list.
    4. Set the check box before the controls you want then click OK in the Options dialog.
    5. Start the form Designer by loading the existing form or creating a new form.
    6. Click insert OLE controls button on the Form Controls toolbar and choose OLE Controls from the popup menu.
    7. The icons of the controls you choose are showed on the Form Controls toolbar. Click the icon to choose a control and insert the control into the form.

    Microsoft Visual Basic for Application (Word, Excel and PowerPoint)

    Start your Office application and load a document or create a new document.

    1. Choose menu Tools|Macro|Visual Basic Editor or press ALT-F11.
    2. The Microsoft Visual Basic for Application design interface appears.
    3. Choose a existing Form or create a new form. Choose menu Tools|Additional Controls... or right-click the Toolbox and choose Additional Controls... from the popup menu.
    4. Find which control you want to use in your project from the Available Controls list.
    5. Set the check box before the controls you want then click OK in the Additional Controls dialog.
    6. The icons of the controls you choose are showed on the Toolbox. Click the icon to choose a control and insert the control into the form.

    Microsoft Access

    Start your Microsoft Access and load a existing database or create a new database.

    1. In the Database windows, choose Forms tab.
    2. Click New to create a Form or click Design to design a existing form.
    3. In the Toolbox, click insert OLE controls button. All controls currently installed on your computer will showed in a popup menu.
    4. Choose a control you want to use in your form by clicking the name of the control in the popup menu.
    5. Insert the control into your form.

    Microsoft Visual C++ 4.x

    Start your Visual C++ 4.x.

    If you only use the OCX in the dialog box

    1. Click the ResourceView tab to choose the resource edit.
    2. Double-click the dialog's name to edit the dialog.
    3. Right-click the dialog and choose Insert OLE Control... from the pop-up menu.
    4. Choose the Control from the OLE control list and click OK.
    5. Then insert the control into the dialog.

    If you want to use the OCX in your project

    1. Load the project.
    2. Choose menu Insert|Component...
    3. Choose the OLE Controls tab.
    4. Choose the Meter Control and click Insert.
    5. Visual C++ will generate several classes of the control,such as CMeter.
    6. Then you can define variable of the type as CMeter.

    Microsoft Visual C++ 5.0 &  6.0

    Start your Visual C++ 5.0.

    If you only use the OCX in the dialog box

    1. Click the ResourceView tab to choose the resource edit.
    2. Double-click the dialog's name to edit the dialog.
    3. Right-click the dialog and choose Insert ActiveX Control... from the pop-up menu.
    4. Choose the Control from the ActiveX control list and click OK.
    5. Then insert the control into the dialog.

    If you want to use the OCX in your project

    1. Load the project.
    2. Choose menu Project|Add To Project|Components and Controls...
    3. Open the Registered ActiveX Control gallery.
    4. Choose the Control and click Insert.
    5. Visual C++ will generate several classes of the control,such as CCounter.
    6. Then you can define variable of the type as CCounter.

    Microsoft Visual Studio.NET

    You can also put ActiveX controls on Windows Forms (VB.NET, C# or other .NET language). Before you can add ActiveX controls to your forms, you must add them to the ToolBox. You can open the Customize Toolbox dialog box from the Tools menu or by right click ToolBox to open it (Choose Windows Forms Tab | Right click the tab and choose "Customize Toolbox..." for VS.Net 2002 or "Add/Remove Items..." for VS.Net 2003, or Click "Choose ToolBox Items" in Tool Menu (Choose "Choose Items" if using Right-Click ToolBox ) for VS2005 ) .

    To add an ActiveX control to your Windows Form

    1. Add the ActiveX Control to ToolBox.
    2. Double-click the control on ToolBox
    3. Resize and position the control in the Windows Form.
    4. Configure properties and write codes to implement your own functions.

    How To Use Windows Form Control

    Windows Form Control can be supported by any development platform which supports Microsoft .Net Framework. How to use the Windows Form Control in VB.Net and C# are listed as follows:

  • Microsoft Visual Basic .Net
  • Microsoft C# 

  • Microsoft Visual Basic .Net

    Start MicroSoft Visual Studio .Net and load your VB.Net project or create a new VB. Net project.

    1. Choose Windows Forms Tab | Right click the tab and choose "Customize Toolbox..." for VS.Net 2002 or "Add/Remove Items..." for VS.Net 2003 or "Choose Items..." for VS.Net 2005.  
    2. In the Customize Toolbox dialog, click the tab named .Net Framework Components, then click the "Browse..." button to choose the DLL which you try to load, and click OK button to add the components you choose to the toolbox.
    3. Add Reference to the project. There are two approaches for you to add the components to the project reference list, 1)just drag the componets in the Toolbox to the Windows Forms, VS.Net will automatically add the component references to your project; 2)Go "Project" menu and click Add Reference item to launch "Add Reference" dialog, in the ".Net" tab, click the "Browse..." button to choose which DLL you want to add the project.
    4. The icons of the controls you choose are showed at the end of the Toolbox. Click the icon to choose a control and insert the control into the form, then set the properties of the control instances.

    Microsoft C#

    Start MicroSoft Visual Studio .Net and load your C# project or create a new C# project.

    1. Choose Windows Forms Tab | Right click the tab and choose "Customize Toolbox..." for VS.Net 2002 or "Add/Remove Items..." for VS.Net 2003 or "Choose Items..." for VS.Net 2005.
    2. In the Customize Toolbox dialog, click the tab named .Net Framework Components, then click the "Browse..." button to choose the DLL which you try to load, and click OK button to add the components you choose to the toolbox.
    3. Add Reference to the project. There are two approaches for you to add the components to the project reference list, 1)just drag the componets in the Toolbox to the Windows Forms, VS.Net will automatically add the component references to your project; 2)Go "Project" menu and click Add Reference item to launch "Add Reference" dialog, in the ".Net" tab, click the "Browse..." button to choose which DLL you want to add the project.
    4. The icons of the controls you choose are showed at the end of the Toolbox. Click the icon to choose a control and insert the control into the form, then set the properties of the control instances.
    How to Order
      Why To Buy
      Online Store
      Email & Fax Order
      Prices
    News
    Dragonfly Chart .Net V2.0 is released ...

    Instrumentation .NET 1.0 is released...

    Graph ActiveX 3.0 is released...

    Graph Ext ActiveX 3.0 is released...

    DOPEC Evaluation Version...

    Help File is updated...

    HTML Samples are available...

    C# Samples (ActiveX) are available ...

    VB.NET Samples (ActiveX) are available ...

    DOPEC System is in final evaluation pahse ...
    Information
      FAQ
      Links
      Privacy
      License Agreement
      Resellers
      Testimonials
      Awards
    Support
      Service
      Consulting
      Documentation
      Tutorials
      Sample Codes

    Copyright 2001 - 2007 Dragonfly Automation Software. All rights reserved.