Shape.OnQueryAccessibilityHelp Method
Raises the QueryAccessibilityHelp event.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaração
Protected Sub OnQueryAccessibilityHelp ( _
e As QueryAccessibilityHelpEventArgs _
)
protected void OnQueryAccessibilityHelp(
QueryAccessibilityHelpEventArgs e
)
protected:
void OnQueryAccessibilityHelp(
QueryAccessibilityHelpEventArgs^ e
)
member OnQueryAccessibilityHelp :
e:QueryAccessibilityHelpEventArgs -> unit
protected function OnQueryAccessibilityHelp(
e : QueryAccessibilityHelpEventArgs
)
Parameters
- e
Type: System.Windows.Forms.QueryAccessibilityHelpEventArgs
A QueryAccessibilityHelpEventArgs that contains the event data.
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnQueryAccessibilityHelp method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors
When you override OnQueryAccessibilityHelp in a derived class, be sure to call the OnQueryAccessibilityHelp method of the base class so that registered delegates receive the event.
Examples
The following example is a method that is executed when the Click event occurs. The Shape class has several methods with the name pattern OnEventName that execute methods when the EventName event occurs. (EventName represents the name of the corresponding event.)
The following example demonstrates how to override the OnClick and OnLostFocus methods in a class that derives from LineShape.
Public Class HighlightLine
Inherits LineShape
Protected Overrides Sub OnClick(ByVal e As EventArgs)
' Change the color of the line when clicked.
Me.BorderColor = Color.Red
MyBase.OnClick(e)
End Sub
Protected Overrides Sub OnLostFocus(ByVal e As System.EventArgs)
' Change the color of the line when focus is changed.
Me.BorderColor = Color.Black
MyBase.OnLostFocus(e)
End Sub
End Class
public class HighlightLine :
LineShape
{
protected override void OnClick(EventArgs e)
{
// Change the color of the line when clicked.
this.BorderColor = Color.Red;
base.OnClick(e);
}
protected override void OnLostFocus(System.EventArgs e)
{
// Change the color of the line when focus is changed.
this.BorderColor = Color.Black;
base.OnLostFocus(e);
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace
Other Resources
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)