Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleUse the RefreshProperties attribute in VB .NET
DescriptionThis example shows how to use the RefreshProperties attribute in VB .NET.
KeywordsRefreshProperties, attribute, VB.NET, property
CategoriesVB.NET
 
The RefreshProperties attribute tells property editors such as the Properties window how to refresh other properties when the value of this one changes. You can set this value to None, Refresh, or All.

This example provides a read-only property named TimeNow. The Properties window displays it as a grayed-out, non-editable property that shows the current time including seconds.

The RefreshesAll property has RefreshProperties set to All. When you modify this property's value, the Properties window reloads all other property values and you can see the value of TimeNow change.

 
Public ReadOnly Property TimeNow() As String
    Get
        Return Now.ToString("h:mm:ss")
    End Get
End Property

Private m_RefreshesAll As String

<RefreshProperties(RefreshProperties.All)> _
Public Property RefreshesAll() As String
    Get
        Return m_RefreshesAll
    End Get
    Set(ByVal Value As String)
        m_RefreshesAll = Value
    End Set
End Property
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated