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

W

Wayne

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."
 
W

Wendy Wei

Wayne said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top