
Setting design-time properties of UserControl constituent controls
Quote:
>Is there a way around this, short of having two UserControls
>(my current approach, with lots of cut&paste code duplication)
You can try to make your control a container, and add the Text box at design
time, using ContainedControls(0). But this in fact will create another control,
occuring in the user application.
Otherwise I'd suggest to use an array of two Text controls, with the
appropriate settings, and remember the index of the active control, to be
visible and used, in your MultiLine property. Then you only must use that
index, to access the appropriate Text control. The other properties, however,
always must be set for *both* controls at design time.
BTW, the reason why MultiLine is read only at runtime might be, that the
underlaying EDIT window, represented in the hWnd property, must be created with
different styles for single and multi line. But dealing with these style bits
requires some API functions, and cooperation with the code in the VB runtime
system, that implements the Text control, is undocumented.
DoDi