Avatar of kmcbrearty
kmcbreartyFlag for United States of America

asked on 

C# to VB Conversion

I have the following code that will solve a problem that I am having.  The issue is that I need to be written in VB rather than C#.

privateT GetParent<T>(DependencyObject obj)
    where T : DependencyObject
{
    if(obj == null)
    {
        returnnull;
    }
    elseif(obj isT)
    {
        return(T)obj;
    }
 
    DependencyObject parent = VisualTreeHelper.GetParent(obj);
    returnGetParent<T>(parent);
}

Open in new window


Any help to convert this code would be greatly appreciated.
C#Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Carl Tawn
Avatar of angus_young_acdc
angus_young_acdc
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi there,

You could try the following:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
Avatar of kmcbrearty
kmcbrearty
Flag of United States of America image

ASKER

I am well aware that conversion programs exist and have already tried them.  Did you bother to even try to use this tool?  The reponse is:

Conversion results
-- line 1 col 1: EOF expected
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo