Design-time properties in Run-time Controls 
Author Message
 Design-time properties in Run-time Controls

VB6 enables creation of controls in run time.
Is there a way to set a design time only property in a Run time created
control?
For instance, I want to create a text box in run time (using Me.Controls.Add
..) but with its MultiLine property set to True. How can this be
accomplished?


Sun, 06 May 2001 03:00:00 GMT  
 Design-time properties in Run-time Controls
Well that would be a trick if it would work but since the props memory for
the control is not even allocated until you issue the create I don't see how
you can pre set props for non-existant controls. You cound use tricks like
building the controls at design time then hide them until needed. Casn't you
set these props at runtime when you do the create?

Quote:
>VB6 enables creation of controls in run time.
>Is there a way to set a design time only property in a Run time created
>control?
>For instance, I want to create a text box in run time (using
Me.Controls.Add
>..) but with its MultiLine property set to True. How can this be
>accomplished?



Sun, 06 May 2001 03:00:00 GMT  
 Design-time properties in Run-time Controls

Quote:

>VB6 enables creation of controls in run time.
>Is there a way to set a design time only property in a Run time created
>control?
>For instance, I want to create a text box in run time (using
Me.Controls.Add
>..) but with its MultiLine property set to True. How can this be
>accomplished?

Unfortunately, the new dynamic control creation method doesn't extend this
far. It's an annoying limitation.

The way I worked around this was to create a user control that had
constituent controls of each type I needed (for example, a single line and a
multiline text box). When the new control was added and the design time
property was set, the appropriate constituent control was displayed and its
events were mirrored by the user control.

The other way is to fall back to the old standard control array method.

Frank Carr



Sun, 06 May 2001 03:00:00 GMT  
 Design-time properties in Run-time Controls


Quote:
>VB6 enables creation of controls in run time.
>Is there a way to set a design time only property in a Run time created
>control?

  Rather than use Controls.Add use Load and control arrays.  New
controls created with the Load function "inherit" the properties of
other controls in the array.

Quote:
>For instance, I want to create a text box in run time (using Me.Controls.Add
>..) but with its MultiLine property set to True. How can this be
>accomplished?

  With Load you would create a TextBox on the form with Index=0.  Set
that TextBox's multiline propertty to true.  All subsequently Loaded
textboxes on that control array will be multiline.

  Hopefully that will work for you.

Later,

Wayne Venables
IDC Global



Sun, 06 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Saving properties of ActiveX control from design time to run time

2. Accessing design time properties in run time

3. Design time or run time, setting properties

4. getting run-time behavior of a contained control in a user control at design time

5. Assign a treeview at design run time to other at design time

6. ADO Data Control - Design Time/Run Time database locations

7. Code running in design time or run-time?

8. web service and updating web reference with vb.net design time vs run time

9. web service and updating web reference with vb.net design time vs run time

10. Design time vs Run time

11. Run Time vs Design Time - No Current Record

12. MsgBox pauses App at Design time but not run time

 

 
Powered by phpBB® Forum Software