Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to subclass an OCX control?
Message
De
08/06/2004 16:12:20
 
 
À
08/06/2004 14:51:27
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00911164
Message ID:
00911362
Vues:
19
Look the VFP8 Help File, DEFINE CLASS there example
   PUBLIC frmOLETest
   frmOLETest = CREATEOBJECT('Form')
   frmOLETest.Visible = .T.
   
   frmOLETest.ADDOBJECT('OCXTest', 'BlueOLEControl', ;
      'MSOutl.Outline')
   frmOLETest.OCXTest.AddItem('Item One')
   frmOLETest.OCXTest.AddItem('Item Two')
   
   DEFINE CLASS BlueOLEControl AS OLEControl
   
      * Set a property of the ActiveX control
      .Object.Backcolor = 16776960
      
      * Set properties of the OLE Container Control
      Visible = .T.
      Height = 100
      Width = 200
   ENDDEFINE
>When I use mscomctllib.listviewctrl.2 (per your example) it does the same thing.
>
>Can you verify?
>
>This is what I have
>
>*AMADDON.PRG
>DEFINE CLASS myListView as olecontrol
> OleClass = 'mscomctllib.listviewctrl.2'
>ENDDEFINE
>
>Create a form and drop a command button on it.
>In the click method, I have
>
>thisform.NewObject('test','myListView','amaddon.fxp')
>
>
>>DId you verify OleClass value for this control?
>>
>>>When I issue "this.NewObject('objectname','classname','procname')" in the form's init, the Activex dialog pops up prompting me to select a control.
>>>
>>>Any idea as to what is happening?
>>>
>>>>
>>>>What error do you get? Try to drop ActiveX on a form and read OLECLASS property.
>>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform