Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incoporate ActiveX

Status
Not open for further replies.

JPIII

Programmer
May 31, 2003
5
CA


HI Someone can help me ?

How can I Incoporate ActiveX control in visual Foxpro 6.0 Prg ????


Thanks !


JP
 
JPIII

It depend what you want to do, if you creating a form by code and you want to add a datetime picker for example, the idea is to find out the name of the activex (in this case its "MSComCtl2.DTPicker.2".) Here is an example (copy the following in a program and run it):
Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	Top = 0
	Left = 0
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	ADD OBJECT olecontrol1 AS olecontrol WITH ;
		Top = 24, ;
		Left = 24, ;
		Height = 24, ;
		Width = 144, ;
		Name = "Olecontrol1",;
		OleClass="MSComCtl2.DTPicker.2"
ENDDEFINE

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
hi Mike Gagnon

thanks

I want use Farpoint Spread v.6.0 ActiveX Control and i don't no what name use in my code to declare it?

How can i find this name for each control i want use?


Thanks!

 
JPIII

For example, if I create a for visually, and add a datetime picker Activex to my form, in the property sheet of the Activex (under OleClass property), the name of the Activex is shown. I would assume the same would apply to "Farpoint Spread v.6.0 ActiveX".

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
JPIII,

In addition to what Mike Gagnon has told you ....

Another way to do it is in the form designer. Drop an "OLE Container Control" onto your form. You can find this in your main VFP form controls toolbar (don't confuse it with the OLE Bound Control, which is quite different).

When you drop the control and release the mouse button, you will see the Windows Insert Object dialogue. Select "Insert control", and scroll down until you see Farpoint control in the list. Click on it, then click OK.

Mike



Mike Lewis
Edinburgh, Scotland
 
Also, I'd guess you're coming to VFP from VB?

"Spread" type controls are common in VB to provide a spreadsheet-like view of data.

However, you might want to check out the Native VFP Grid control, which is, in many ways, more powerful than any Spreadsheed ActiveX control I've seen...

There are some things that the VFP grid control can't do: The data you view/edit in the grid must be contained in a cursor (whether that cursor is a table, the result of a SELECT statement, or a temporary CREATE CURSOR command doesn't matter). If the cursor is not read only for some reason, you can set the grid up to be editable.

What is it you want to use this control for??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top