Patang,
As the others suggests. Left & Right are properties of Forms. If you attempt
to use the Left & Right functions on a form you will receive this error.
What I normally do is use an import alias in my form class files.
Something like:
Imports VB = Microsoft.VisualBasic
Public Class MainForm
Inherits System.Windows.Forms.Form
...
Public Sub SomeMethod()
Dim s As String
s = "the"
s = VB.Right(s, 2)
End Sub
End Class
The advantage of the import alias "VB = Microsoft.VisualBasic" is that it
will work with all types (classes, modules, enums, ...) in the
Microsoft.VisualBasic namespace.
Hope this helps
Jay
[quoted text, click to view] "patang" <patang@discussions.microsoft.com> wrote in message
news:767DEB4B-A2C1-4261-A419-56F6733291E7@microsoft.com...
> This is really silly question.
>
> Dim s As String
> s = "the"
> s = Right(s, 2)
>
> Why this gives me compilation error? (This works in VB6 .. what do I have
> to
> do to make it work in VB.Net)
>
> I have imported this:
>
> imports system.string
>
>