Solved

User Control Property Events

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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