Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 13

Detecting which Complex Property is being Edited with the EditProperty Event

The EditProperty event fires when the developer starts to edit a property that you have directly connected to a Property Page. As we discussed in the previous section, it's possible to connect one or more complex properties directly to a Property Page rather than an entire control. When you connect a property directly to a Property Page in this way, the entry for the property in the Properties Window displays an ellipsis (…) to the right of the property value. The developer can click on the ellipsis to bring up your Property Page for that property.

Because it's possible to connect more than one complex property directly to a Property Page, there may be elements on the Property Page that aren't appropriate for every property that you've connected to it.

That is where the EditProperty event comes in handy. You can use the EditProperty event's string property parameter, PropertyName, to check on which property the developer is trying to edit, as we do in Listing 13.20. Depending on which property the developer is editing, you can enable, disable, hide, reveal, or set focus to elements on the Property Page.

LISTING 13.20
USING THE EDITPROPERTY EVENT PROCEDURE TO DETERMINE THE CONFIGURATION OF THE PROPERTY PAGE

Private Sub EditProperty(PropertyName As String)
   If Ucase$(PropertyName) = "TEMPDATE" Then
      txtTempDate.SetFocus
      chkIsFahrenheit.enabled = False
   Else
      . . . other stuff
   End If
End Sub


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved