create custom property for textbox!? 
Author Message
 create custom property for textbox!?

Hi there,
I want to create a custom property for a standard textbox or combobox. The
property should be a boolean and perform several actions:
e.g. if I state:  me.txtName.Owner = true

the following should happen with the control:

me.txtName.enabled = false
me.txtName.Locked = true
me.txtName.ForeColor = 16777215

etc..

When me.txtName.Owner = false other values should be set for the properties
given in this example.

How do I get to this? I have many textboxes in many places that I want to
change in an easy way instead of having to give the properties of every
textbox again and again.
Thanks in advance,
Jeroen

Please remove NOSPAM from my email address when replying



Fri, 28 Dec 2001 03:00:00 GMT  
 create custom property for textbox!?
I think that its not necessary to create properties to accomplish such
task. You can create a function that sets such visible properties.
Eg:
Function hide_control ( c as control , truefalse as boolean ) as boolean
         on error goto hide_control_error
         c.enabled = truefalse
         c.locked = not truefalse
         c.forecolor = iif ( truefalse , 11111 , 16777215 )
         hide_control = true
         exit sub
hide_control_error :
         hide_control = false
end sub

If it happens that you must have different settings for some controls you
can save this settings in the TAG property of the control, in a format
easily understandable.



Quote:
> Hi there,
> I want to create a custom property for a standard textbox or combobox.
The
> property should be a boolean and perform several actions:
> e.g. if I state:  me.txtName.Owner = true

> the following should happen with the control:

> me.txtName.enabled = false
> me.txtName.Locked = true
> me.txtName.ForeColor = 16777215

> etc..

> When me.txtName.Owner = false other values should be set for the
properties
> given in this example.

> How do I get to this? I have many textboxes in many places that I want to
> change in an easy way instead of having to give the properties of every
> textbox again and again.
> Thanks in advance,
> Jeroen



Fri, 28 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating properties of custom properties?

2. Custom control with property like Listbox and textbox (multiline)

3. create custom icon,custom combobox in custom toolbar

4. create custom icon,custom combobox(to insert values)in custom toolbar

5. Unable to create custom properties in Access.

6. Q: Create custom property on form/report controls ?

7. How to create a template with custom properties

8. Creating Lines that Link to Custom Properties

9. Creating Parent property for a custom class

10. Creating and Searching by Custom Properties

11. Create custom control change property default

12. Can't create and set a new custom database property

 

 
Powered by phpBB® Forum Software