Thursday, February 25, 2010

Hide a Base class property in Inherited class (Custom Control)

In case you are extending a control and you want your extended control not to display the Base control's (class) property in the designer view then you should be follwing this steps.

Example:
-----------
Suppose you are extending the TreeView Control and you want the TreeView Control's ShowCheckBoxes property to be hidden in the extended Control. Here are the steps you should follow to establish that.

1> Create a Class,i.e, TreeViewExtender, inherit it from TreeView Class.
2> Create a property with the same Name and ReturnType as it is in the Base Class.
3> Use the new operator whch is used to explicitly hide a member inherited from a base class. (To hide an inherited member, declare it in the derived class using the same name, and modify it with the new modifier.)
4> Use the BrowsableAttribute and set its value to false.

public class TreeViewExtender : TreeView
{
#region Properties

[Browsable(false)]
public new TreeNodeTypes ShowCheckBoxes
{
get
{
return base.ShowCheckBoxes;
}
set
{
base.ShowCheckBoxes = value;
}
}

#endregion
}

Note: The [Browsable(false)] is for whether it shows up in the designer property grid or not but it would be accessed from the editor or code behind.
In order to stop the assignment to this property make it a read-only property by removing the setter from the Property in the Derived Class.

Monday, January 4, 2010

Google Transliteration IME Softwares

One tool which will help us express better now ;)

http://www.google.com/ime/transliteration/
Read this page 'bout how to enable this in your Operating System: http://www.google.com/ime/transliteration/help.html

Alternative:
----------------
Another alternative by Google. By using Browser Bookmark ONLY. No installation required.

This works If you are having internet connectivity and can be turned on for ANY page. Read more here:
http://t13n.googlecode.com/svn/trunk/blet/docs/help_hi.html