` Printed Icetips Article

Icetips Article



Par2: OCX - clarification of docs
1998-06-25 -- Nigel Hicks
 
>Now my goal is to be able to use all properties of this control,
>this means 'DESIGN-TIME' and 'RUN-TIME' properties. At the
>moment I can use all 'RUN-TIME' properties just fine, just the
>'DESIGN-TIME' properties give me a headache.

>The most important property which I want to get working is the 'ScrollBars'
>property, because then the ocx control will then handle all events for this
>one itself.
>

I have looked into this briefly and here are the results:

1) It is not well documented (if at all) but C4 does not support setting
custom properties (design or runtime) on 32-bit OCXes from the Window
Formatter. The custom menu is present but this will only affect the control
within Window Formatter (i.e. the properties are neither saved nor read).
It is however planned that C5 (currently in beta test) will support setting
both runtime properties and designtime (via an OLR file) properties.

2) In C4, as you have discovered, runtime properties can be set on the OLE
control line or as property assignments:
e.g.

OLE,AT(10,6,182,190),USE(?RTFEdit1),CREATE('RICHTEXT.RichtextCtrl.1'),
 COMPATIBILITY(021H),AUTOSIZE, |
     'MousePointer'('3')

or:      ?RTFEdit1{'MousePointer'} = 3

3) Design time properties are more troublesome. These must be set using OLR
files. These OLR files can be created using the OCXPRP32 program (supplied
in source form). However there is currently a bug with the program that does
not put the control into design mode, which means that some controls do not
respond to DoVerb(-7) which triggers the property pages.

I attach a new OCXPRP32.CLW that fixes this.

To use an OLR use a OLE control line of the form:

OLE,AT(10,6,182,190),USE(?RTFEdit1),CREATE('RICHTEXT.RichtextCtrl.1',
'rtf.olr\!ole1'), |
         COMPATIBILITY(021H),AUTOSIZE

To create the OLR
  a) start ocxprp32 (made from the attached file)
  b) select the control (Microsoft Rich Text)
  c) select the menu command Properties\Custom  (ensure Properties\Design
      mode is checked)
  d) set the desired properties.
  e) select the menu command file\save as
  f) specify the name of the OLR file (rtf.olr in the example above)
  g) specify the component name (ole1 in the above example)
  The file RTF.OLR will then be created an can be used by your app.

Incidentally, note that the RTF Edit control only enables the scrollbars
when there is enough text to require them.



Printed November 23, 2024, 8:22 pm
This article has been viewed/printed 35204 times.