Click here to Skip to main content
12,352,083 members (32,706 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.7K views
1 bookmarked
Posted

Find a Parent Control Recursively

, 22 Sep 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Here's the VB.NET version:Public Shared Function FindParentAsTabControl(ByRef startCntrl As Control) As Control Dim retCntrl As Control = Nothing If(startCntrl.Parent IsNot Nothing) If(TypeOf(startCntrl.Parent) is TabControl) retCntrl = startCntrl.Parent ...
Here's the VB.NET version:

Public Shared Function FindParentAsTabControl(ByRef startCntrl As Control) As Control
    Dim retCntrl As Control = Nothing
    If(startCntrl.Parent IsNot Nothing)
        If(TypeOf(startCntrl.Parent) is TabControl)
            retCntrl = startCntrl.Parent
        Else
            retCntrl = FindParentAsTabControl(startCntrl.Parent)
        End if
    End If
    Return(retCntrl)
End Function

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

RenatoK
Software Developer (Senior)
Australia Australia
No Biography provided

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 22 Sep 2010
Article Copyright 2010 by RenatoK
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid