C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Extender Provider Components in .NET Framework


Posted Date: 20 Jul 2009    Resource Type: Articles    Category: .NET Framework
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 12



Extender providers are components that impart additional properties to controls.



Take the ToolTipProvider for example.



When you place an instance of a ToolTipProvider on a form, every control on that form receives a new property. This property can be viewed an set in the Properties window, where it appears as ToolTip on MyTooltip, where MyTooltip is the name of the ToolTipProvider.At run time, the value of this property is displayed in a yellow box when the mouse hovers over a control.



Extender providers are usually used to provide information to the users at run time. As we have seen, the ToolTipProvider can be used to provide Tool Tips at run time.



Other extender providers include the



 



a) HelpProvider



b) ErrorProvider



 



To use an extender provider in your project





1. Add a component of the appropriate extender type (such as ErrorProvider) to your form. The component appears in the component tray.



2. In the Properties window, set appropriate values for the properties provided by the extender provider.



The properties provided by extender providers actually reside in the extender providers themselves, not within the controls they extend. Thus they are not true properties of the component and cannot be accessed in code at run time. The extender provider implements methods that can be used to access the properties it provides. By convention, these methods are always called Getprop and Setprop where prop is the name of the property provided.



Thus the ToolTipProvider implements methods named GetToolTip and SetTooltip, which can be used in code to access or dynamically change the value of the Tool Tip stored for a particular control. Both methods take a reference to the appropriate control as an argument, and theSet methods require a value to which the property is to be set.



To access the value of an extender property at run time




Use the Get method implemented for that property. You must supply a reference to the appropriate control.



Example:




Dim myToolTip As String



myToolTip = ToolTip1.GetToolTip(btnData)




To set the value of an extender property at run time





Use the Set method implemented for that property. You must supply a reference to the appropriate control and a new value for that property.



Example:




ToolTip1.SetToolTip(btnData, “Click me to display the data”)




For more details, visit http://vijirajkumar.blogspot.com/2009/07/extender-provider-components-in-net.html



Responses to the resource: "Extender Provider Components in .NET Framework"

No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Extender Provider Components  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: .NET Interview Questions - Part 9
Previous Resource: Parameters in c#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources




About Us    Contact Us    Privacy Policy    Terms Of Use