View Single Post
  #5 (permalink)  
Old 07-03-2007, 12:15 PM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 317
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
This is the hook if you ever wanted to retrieve the value that you've set. Say you wanted all form elements to use the same background color that you set your user control. You could set the color of your user control to red, enumerate over all other controls on the form, and "Set" their background color from the "Get" of your User control.

In all reality, if you wanted to limit it to "Set Only" you could change it the property to WriteOnly but then your loosing the ability to get the value realtime.

Code:
Public Class UserControl1
    Public WriteOnly Property TextBoxBackgroundColor() As Color
        Set(ByVal value As Color)
            TextBox1.BackColor = value
            TextBox2.BackColor = value
            TextBox3.BackColor = value
            TextBox4.BackColor = value
            TextBox5.BackColor = value
        End Set
    End Property
End Class

Last edited by ccoonen : 07-03-2007 at 12:17 PM.
Reply With Quote