Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI TO ALL,
i am working with c#.net windows application and in one of requrement i need to chage the parameters of a method of the inbuild c#.net control can any one pls help me regarding this...
see the CodeLine-1 below the custom tooltip have method called "show" here it will take only controls as the references to show the tooltip i need to change the method some thing like codeLine-2

CodeLine-1:CustomTooltip.Show(SomeText, control1);
codeLine-2:CustomTooltip.Show(SomeText, SomeText);
any one pls help me how achive it

I dont want the tooltip associated with any control i need it is associated with some text
Posted
Updated 5-Sep-11 0:13am
v4
Comments
Sergey Alexandrovich Kryukov 5-Sep-11 2:44am    
Do you need to change a profile of the method (types of parameters) or you need to change the values?
--SA
rajesh.r4321 5-Sep-11 2:49am    
ya i need to cahange the profile of the method
GParkings 5-Sep-11 4:16am    
please clarify what you want the new method signature to achieve.

your code line 1 seems fairly straight forward and i would expect such a method to apply tooltip text specified in the first argument (in your example the specified "" would clear the tooltip text) tot he control specified int he second argument.

your required method signature (code line 2) would have me seriously scratching my head as to what it actually DID as it takes 2 string arguments and no control argument, which string is the tooltip text and WHERE is the tooltip being shown?
rajesh.r4321 5-Sep-11 6:11am    
pls check the question now that is my reguirement i sturked here pls any one help me

Your question isn't very clear.

If I understood you correctly, you can inherit your own class from the built in class and then use for example new keyword to override a method.

However, you cannot use this technique to replace a method with some other parameters that are different than original parameters, you can just 'replace' the original implementation. For more info see: http://msdn.microsoft.com/en-us/library/51y09td4(v=vs.71).aspx#vclrfnew_newmodifier[^].

You can add new methods for inherited classes that are not included in the original class and you can also use extension methods[^] to add functionality to a builtin class without having to derive a new class from it if that's what you're after.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900