Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetService Method
Collapse the table of content
Expand the table of content

Component.GetService Method

Returns an object that represents a service provided by the Component or by its Container.

[Visual Basic]
Protected Overridable Function GetService( _
   ByVal service As Type _
) As Object
protected virtual object GetService(
 Type service
protected: virtual Object* GetService(
 Type* service
protected function GetService(
   service : Type
) : Object;


A service provided by the Component.

Return Value

An Object that represents a service provided by the Component.

This value is a null reference (Nothing in Visual Basic) if the Component does not provide the specified service.


This method can be overridden by a derived class.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Component Class | Component Members | System.ComponentModel Namespace | IContainer | Container | ISite | IServiceProvider

© 2015 Microsoft