I/O
ActiveX Control in Visual FoxPro
-
-
Inserting the Control:
-
From the menu: "View" -> "Form
Controls Toolbar".
-
Select "OLE Container Control" on
Form Controls
Toolbar.
-
Drop control on form.
-
Select "Insert Control".
-
Scroll down and select "IO Control".
-
Click "OK".
-
OR:
-
From the menu: "Tools", "Options",
"Controls".
-
Select "ActiveX Controls".
-
Scroll down and select "IO Control".
-
Click "OK".
-
On "Forms Control Toolbar", "View
Classes"
-> "ActiveX".
-
Select "IO Control" from the "Forms
Control
Toolbar" and drop it on the form.
-
-
CODE:
-
ThisForm.Olecontrol1.Open("COM2:",
"baud=9600
parity=N data=8 stop=1");
-
ThisForm.Olecontrol1.SetHandshaking(2);
'Serial
ports Only. 0 = None, 1 = Xon/Xoff, 2 = Hardware
-
ThisForm.Olecontrol1.WriteString("Hello
World
");
-
ThisForm.Olecontrol1.Close();
-
Note: Olecontrol may have a different
number
than 1 as in the example. This number depends on if you have other
controls
that you are using.
Home
Page | Site
Map | Copyright (c) 1998 by JSPayne
of Cortland NY