Thanks for all that participate in solving my problem.
I still have a question that did not solved.
I'll list my understanding and please let me know if somethings incorrect.
- Every class must has a based class and its root must be System.Object.
- In System.Object has ToString method that overridable.
- So, If I declare a class without Inherits clause.
Does it inherits from System.Object by default? Why it does not show
(Overrides) section in "Class Name" dropdown list.
Public Class Person
Public FirstName, LastName As String
' ---- How can I create an overrides function of System.Object.ToString here,
' ---- with helpping from Visual Studio .Net IDE?
' ---- Which I currently know is _manually_ type the function header
' ---- with a correct signature as this:
Public Overrides Function ToString() As String
Return FirstName & " " & LastName
End Function
End Class
Thank again,
Surrealist.
"Phill. W" wrote:
> "Surrealist" <(E-Mail Removed)> wrote in message
> news:2D3486D1-D6CC-4DEB-9148-(E-Mail Removed)...
> > It's work fine for a Form.
> >
> > But how about if I create my own class?
> > It's not has (Overrides) for me.
>
> I suspect you only see an Overrides section when there's something
> to override. You need to declare the methods in your Base class as
> Overridable, as in
>
> [Base1.vb]
> Public Class Base1
> Public Overridable Sub Pop()
> . . .
> End Sub
> End Class
>
> [Derived1.vb]
> Public Class Derived1
> Inherits Base1
>
> Public Overrides Sub Pop()
> . . .
> End Sub
>
> End Class
>
> HTH,
> Phill W.
>
> >
> > Thanks.
> > Surrealist.
> >
> >
> > "Herfried K. Wagner [MVP]" wrote:
> >
> > > * "=?Utf-8?B?U3VycmVhbGlzdA==?=" <(E-Mail Removed)>
> scripsit:
> > > > I need something likes as when I create an event procedure.
> > > > I can use top-left and top-right dropdown list of code editor
> > > > to select object and its exposed events respectively.
> > > >
> > > > Then, the IDE, automatically paste the function
> > > > header (signature) for me.
> > > >
> > > > But I can't find a way to see list of Sub or Function
> > > > that I can overrides such as ToString Function.
> > >
> > > Select "(Overrides)" in the left combobox, and then the method you want
> > > to override in the right combobox (works for 'ToString').
> > >
> > > --
> > > Herfried K. Wagner [MVP]
> > > <URL:http://dotnet.mvps.org/>
> > >
>
>
>
|