Solved

User Control Property Events

Posted on 2009-04-09
2
177 Views
Last Modified: 2012-05-06
I created a user control that contains a label, Label1, and several public properties, including the string DPDC.

I would like the text property of Label1 to be set to the value of string property DPDC when this property is set.

How can I add an event to perform this?

Thanks
Private _dPDC As String

    Public Property DPDC() As String

        Get

            DPDC = _dPDC

        End Get

        Set(ByVal value As String)

            _dPDC = value

        End Set
 

    End Property

Open in new window

0
Comment
Question by:GIANTOCR
2 Comments
 
LVL 2

Accepted Solution

by:
nicksbell earned 500 total points
ID: 24105808
Just put it in the Set statement of the property.
Private _dPDC As String

    Public Property DPDC() As String

        Get

            DPDC = _dPDC

        End Get

        Set(ByVal value As String)

            _dPDC = value

            Label1.Text = Value

        End Set

 

    End Property

Open in new window

0
 

Author Closing Comment

by:GIANTOCR
ID: 31568440
That was simple enough. Thanks for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now