Add a "Default" to that property and then you can call it as myClass(2) = "SomeMessage". Default Public Property Notes(ByVal index As Integer) As String Get Return m_Notes(index) End Get Set(ByVal Value As String) m_Notes(index) = Value End Set End Property
Lewis Moten
Posts
-
Little VB .NET Syntax Problem!! -
Treeview and regexIn a nutshell ... Private Sub btnMatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMatch.Click targetTree.Nodes.Clear() Dim Expression As New Regex(txtExpression.Text) Dim Matches As MatchCollection For Each node As TreeNode In sourceTree.Nodes If Expression.IsMatch(node.FullPath) Then targetTree.Nodes.Add(node.Clone) End If CheckNodes(Expression, node, targetTree) Next End Sub Private Sub CheckNodes(ByVal expression As Regex, ByVal node As TreeNode, ByVal target As TreeView) For Each child As TreeNode In node.Nodes If expression.IsMatch(child.FullPath) Then NodeParent(target, node).Nodes.Add(child.Clone) End If CheckNodes(expression, child, target) Next End Sub Private Function NodeParent(ByVal target As TreeView, ByVal node As TreeNode) As TreeNode If node.Parent Is Nothing Then For Each Parent As TreeNode In target.Nodes If Parent.Text = node.Text Then Return Parent Next Return target.Nodes.Add(node.Text) End If Return NodeParent(target, node.Parent).Nodes.Add(node.Text) End Function
-
DoEventsNot sure why your application object isn't instantiated, but you could also try the tell the thread to whait a brief moment. System.Threading.Thread.CurrentThread.Sleep(500)