-
August 27th, 2013, 11:04 AM
#1
[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
-
August 27th, 2013, 12:26 PM
#2
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
-
August 28th, 2013, 01:59 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|