?
Solved

User Control Property Events

Posted on 2009-04-09
2
Medium Priority
?
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
nicksbell earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

777 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