Prevent the control from gaining focus
Currently, RadCommandBar receives the focus. One can easily override this behavior and do not allow the control to become focused. Here are the three simple steps that need to be followed:
Create a custom class that derives from RadCommandBar;
Override the ThemeClassName property, so that the theming mechanism can recognize the new control as a RadCommandBar;
Override the ProcessFocusRequested method and return false.
class MyCommandBar : RadCommandBar
{
public override string ThemeClassName
{
get
{
return typeof(RadCommandBar).FullName;
}
}
protected override bool ProcessFocusRequested(RadElement element)
{
return false;
}
}
Class MyCommandBar
Inherits RadCommandBar
Public Overrides Property ThemeClassName() As String
Get
Return GetType(RadButton).FullName
End Get
Set(ByVal value As String)
End Set
End Property
Protected Overrides Function ProcessFocusRequested(element As RadElement) As Boolean
Return False
End Function
End Class