Solved

User Control Property Events

Posted on 2009-04-09
2
178 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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