Last one for now... How do I convert this C# code to VB.NET

Discussion in 'ASP .Net Building Controls' started by Wayne, Nov 29, 2003.

  1. Wayne

    Wayne Guest

    C#

    if (s is MyPanelStyle) {
    ....
    }



    I thought this would work but it is not...


    If s is MyStyles.Button Then
    ....
    End If


    ....but I get a blue squiggly 'Button' is type in 'MyStyles' and cannot be
    used as an expression.
    Wayne, Nov 29, 2003
    #1
    1. Advertising

  2. Wayne

    Teemu Keiski Guest

    If TypeOf(s) Is MyPanelStyle Then
    ....
    End If

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Wayne" <> wrote in message
    news:eu%...
    > C#
    >
    > if (s is MyPanelStyle) {
    > ...
    > }
    >
    >
    >
    > I thought this would work but it is not...
    >
    >
    > If s is MyStyles.Button Then
    > ...
    > End If
    >
    >
    > ...but I get a blue squiggly 'Button' is type in 'MyStyles' and cannot be
    > used as an expression.
    >
    >
    Teemu Keiski, Nov 30, 2003
    #2
    1. Advertising

  3. Wayne

    Wendy Wei Guest

    "Wayne" <> wrote in message news:<eu#>...
    > C#
    >
    > if (s is MyPanelStyle) {
    > ...
    > }
    >
    >
    >
    > I thought this would work but it is not...
    >
    >
    > If s is MyStyles.Button Then
    > ...
    > End If
    >
    >
    > ...but I get a blue squiggly 'Button' is type in 'MyStyles' and cannot be
    > used as an expression.


    Try TypeOf s is MyStyles.Button
    Wendy Wei, Dec 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGVubg==?=

    Should one convert to ASP.NET 2.0 now

    =?Utf-8?B?TGVubg==?=, Dec 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    380
    Steve C. Orr [MVP, MCSD]
    Dec 7, 2005
  2. $Need C Programmer$

    Email NOW $$ HIGH $$ C Programmer WANTED NOW!!

    $Need C Programmer$, Aug 2, 2006, in forum: C Programming
    Replies:
    2
    Views:
    695
    Christopher Benson-Manica
    Aug 2, 2006
  3. sangram
    Replies:
    16
    Views:
    1,955
  4. Johny
    Replies:
    8
    Views:
    371
  5. .NET Follower
    Replies:
    0
    Views:
    110
    .NET Follower
    Feb 9, 2004
Loading...

Share This Page