How to use ActiveX in VB (Visual BASIC) | ||
|
The following is a step-by-step lesson on how to use ActiveX in Visual BASIC (VB). For other VB varieties, including Visual Basic 2008, please visit our classroom . In this lesson, we will use Ultimaserial ActiveX to develop a data acquisition application with DATAQ's Starter kit. Specification of the sample program:
Before we start, please download and install UltimaSerial then run Visual BASIC, and make sure the ToolBox is on the your screen. If not, follow View->ToolBox to enable it. The ToolBox looks like this: 1) Place the mouse cursor on the ToolBox area, click on the right button of the mouse and select Components... and you will see this dialogue box: 2) Select UltimaSerial ActiveX Control and XChart from UltimaSerial, then hit OK to bring these two controls into the ToolBox. If you can't find UltimaSerial and XChart in the list, you need to install UltimaSerial control. Now, the ToolBox should be like this: 3) Place UltimaSerial, XChart and Button from the ToolBox to the blank form of the project. 4) Double Click on Command1 and Command2 button to create the basic codes for them. 5) In the code editor, double-click on the NewData event of object UltimaSerial1 to use the event 6) In the code editor, change the default codes (If you decide to type in the codes, you will notice the properties and methods will be displayed in a drop-down menu once you typed in ultimaserial1.) From:
To: (Watch for the blue text, we assume button Command1 and 2 for Start and Stop action)
Now you can run the program by following Run->Start, or simply hitting F5 key! Last update: 11/18/16 Copyright: 2000-2005 www.UltimaSerial.com
|