Adding a custom property to a form 
Author Message
 Adding a custom property to a form

Hello Mr. President,

It's very easy to add a property to a form

General Declarations area
-------------------------------------
Private m_bMyVariable as Boolean

Public Property Get MyVariable() As Boolean

    MyVariable = m_bMyVariable

End Property

Public Property Let MyVariable(NewData As Boolean)

    m_bMyVariable = NewData

End Property

HTH

Andrew



Sun, 10 Jun 2001 03:00:00 GMT  
 Adding a custom property to a form

It's very easy to add a property to a form

General Declarations area
-------------------------------------
Private m_bMyVariable as Boolean
Public Property Get MyVariable() As Boolean
    MyVariable = m_bMyVariable
End Property
Public Property Let MyVariable(NewData As Boolean)
    m_bMyVariable = NewData
End Property
------------------------------snip--------------------------
Pardon my ignorance- but what is the point of doing this?
Can you not just use

MyVariable = m_bMyVariable, etc

and eliminate a level of complexity in the programming?

.--
Don Kelly

remove the "bull " to reply



Thu, 14 Jun 2001 03:00:00 GMT  
 Adding a custom property to a form
Hello Don,

You are correct, of course. The purpose of property procedures is to ensure
encapsulation and protect the data in your class(in this case a form). Doing
this allows you to check what values are being assigned and to reject those
values if they are not acceptable. It will also give you a place to do any
formatting you may need.

Although in this case it may not be necessary, it's a good idea to follow
OOP rules all the time.

I started my programming career in C++ and I guess I'm still stuck with what
I learned then.

Regards,

Andrew



Fri, 15 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Windows forms designer automatically adds code that sets properties of custom controls

2. Custom Property changes in Custom Outlook Form

3. Create custom control in form using code (code wizard adding ocx to form)

4. Problems adding custom property pages

5. how to add custom properties to folder?

6. Adding custom properties and assigning values.

7. Adding Custom Properties in VBA

8. custom properties when adding a shape

9. VBA to add custom meta data properties

10. Adding custom property

11. How to Add custom properties to VB Controls?

12. how to get custom form and send custom form from VB

 

 
Powered by phpBB® Forum Software