How do I convert this... from C# to VB.NET

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

  1. Wayne

    Wayne Guest

    public MyPanelStyle(StateBag bag) : base(bag) {
    }



    These do NOT work, what I think the conversion should be...



    Sub New(ByVal bag As StateBag)
    Inherits CType(bag, base)

    End Sub

    However, I get a blue squiggly under Inherits "Statement is not valid inside
    a method."



    Sub New(ByVal bag As StateBag) Inherits CType(bag, base)

    End Sub

    I get a blue squiggly under Inherits CType(bag, base) "End of statement
    expected."
     
    Wayne, Nov 29, 2003
    #1
    1. Advertising

  2. Wayne

    Teemu Keiski Guest

    Public Sub New(ByVal bag As StateBag)
    MyBase.New(bag)
    End Sub


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

    "Wayne" <> wrote in message
    news:...
    > public MyPanelStyle(StateBag bag) : base(bag) {
    > }
    >
    >
    >
    > These do NOT work, what I think the conversion should be...
    >
    >
    >
    > Sub New(ByVal bag As StateBag)
    > Inherits CType(bag, base)
    >
    > End Sub
    >
    > However, I get a blue squiggly under Inherits "Statement is not valid

    inside
    > a method."
    >
    >
    >
    > Sub New(ByVal bag As StateBag) Inherits CType(bag, base)
    >
    > End Sub
    >
    > I get a blue squiggly under Inherits CType(bag, base) "End of statement
    > expected."
    >
    >
    >
     
    Teemu Keiski, Nov 30, 2003
    #2
    1. Advertising

  3. Wayne

    Wendy Wei Guest

    "Wayne" <> wrote in message news:<>...
    > public MyPanelStyle(StateBag bag) : base(bag) {
    > }
    >
    >
    >
    > These do NOT work, what I think the conversion should be...
    >
    >
    >
    > Sub New(ByVal bag As StateBag)
    > Inherits CType(bag, base)
    >
    > End Sub
    >
    > However, I get a blue squiggly under Inherits "Statement is not valid inside
    > a method."
    >
    >
    >
    > Sub New(ByVal bag As StateBag) Inherits CType(bag, base)
    >
    > End Sub
    >
    > I get a blue squiggly under Inherits CType(bag, base) "End of statement
    > expected."


    Try Sub New(ByVal bag As StateBag)
    MyBase.New(bag)
    End Sub
     
    Wendy Wei, Dec 3, 2003
    #3
  4. Wayne

    Wendy Wei Guest

    >
     
    Wendy Wei, Dec 4, 2003
    #4
    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. Andreas Klemt
    Replies:
    1
    Views:
    405
    Karl Seguin
    Jul 23, 2003
  2. Jaap
    Replies:
    4
    Views:
    727
    John O'Conner
    Jul 10, 2006
  3. Klaus Neuner
    Replies:
    7
    Views:
    506
    Klaus Neuner
    Jul 26, 2004
  4. sck10
    Replies:
    4
    Views:
    16,038
    daniel
    Sep 3, 2006
  5. Replies:
    5
    Views:
    1,952
    Wesley Hall
    Nov 4, 2006
Loading...

Share This Page