[RESOLVED] How to set a default value of a TreeNode
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [RESOLVED] How to set a default value of a TreeNode

Hybrid View

  1. #1
    Join Date
    May 2013
    Posts
    5

    [RESOLVED] How to set a default value of a TreeNode

    VB.NET 2010, Framework 3.5

    I have a procedure where I want to have an Optional TreeNode as a parameter. The problem is that Optional parameters must have a default value and I can't figure out how to assign a default value??

    Code:
    Public Sub Hello(Optional treeNode As TreeNode = ??)
       ' stuff
    End Sub

  2. #2
    Join Date
    May 2013
    Posts
    5

    Re: How to set a default value of a TreeNode

    I figured it out, very simple once I saw it. .

    Code:
        Public Sub world(Optional tv As TreeNode = Nothing)
            If tv Is Nothing Then
                ' code for nothing
            Else
                ' code for not nothing
            End If
        End Sub

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,101

    Re: How to set a default value of a TreeNode

    Thanks for sharing your solution with us! Please mark your thread as resolved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center