windowsforms-devexpress-dot-utils-dot-tooltipcontrollereventargsbase.md
Gets or sets the control for which a tooltip controller’s event is fired.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
public Control SelectedControl { get; set; }
Public Property SelectedControl As Control
| Type | Description |
|---|---|
| Control |
A Control object for which the event is fired.
|
Use the SelectedControl property to get the control for which a tooltip controller’s event is fired. If a tooltip is invoked for a GridControl‘s element, for instance, the SelectedObject property will refer to the grid itself. If the tooltip is about to be displayed for the SimpleButton, then SelectedControl will refer to this button, etc
For controls that support displaying different tooltips for different control elements (GridControl, ButtonEdit, for instance), you can use the ToolTipControllerEventArgsBase.SelectedObject property to access the required element.
The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedControl property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-treelist-customize-cell-tooltip/CS/Form1.cs#L22
private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) {
if(e.SelectedControl is DevExpress.XtraTreeList.TreeList) {
TreeList tree = (TreeList)e.SelectedControl;
winforms-grid-forcibly-show-cell-tooltips/CS/AlwaysShowCellHints/Form1.cs#L21
private void toolTipController1_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e) {
if(e.Info == null && e.SelectedControl == gridControl1) {
GridView view = gridControl1.FocusedView as GridView;
winforms-grid-display-popup-image-on-mouse-hover/CS/Form1.cs#L24
{
if (e.SelectedControl != gridControl1) return;
ToolTipControlInfo info = null;
winforms-checked-combobox-show-tooltips-for-selected-items/CS/WindowsApplication3/Form1.cs#L124
{
if(e.SelectedControl == checkedComboBoxEdit1)
{
show-super-tooltip-for-disabled-control/CS/ToolTipController/Form1.cs#L51
DevExpress.Utils.ToolTipControllerShowEventArgs showArgs = ToolTipController.CreateShowArgs();
showArgs.SelectedControl = ActiveButton;
showArgs.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;
winforms-treelist-customize-cell-tooltip/VB/Form1.vb#L22
Private Sub toolTipController1_GetActiveObjectInfo(ByVal sender As Object, ByVal e As DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs)
If TypeOf e.SelectedControl Is TreeList Then
Dim tree As TreeList = CType(e.SelectedControl, TreeList)
winforms-grid-forcibly-show-cell-tooltips/VB/AlwaysShowCellHints/Form1.vb#L23
Private Sub toolTipController1_GetActiveObjectInfo(ByVal sender As Object, ByVal e As ToolTipControllerGetActiveObjectInfoEventArgs) Handles toolTipController1.GetActiveObjectInfo
If e.Info Is Nothing AndAlso e.SelectedControl Is gridControl1 Then
Dim view As GridView = TryCast(gridControl1.FocusedView, GridView)
winforms-grid-display-popup-image-on-mouse-hover/VB/Form1.vb#L24
Private Sub toolTipController1_GetActiveObjectInfo(ByVal sender As Object, ByVal e As ToolTipControllerGetActiveObjectInfoEventArgs)
If e.SelectedControl IsNot gridControl1 Then Return
Dim info As ToolTipControlInfo = Nothing
winforms-checked-combobox-show-tooltips-for-selected-items/VB/WindowsApplication3/Form1.vb#L112
Private Sub OnGetActiveObject(ByVal sender As Object, ByVal e As DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs) Handles toolTipController1.GetActiveObjectInfo
If e.SelectedControl Is checkedComboBoxEdit1 Then
Dim editInfo As PopupContainerEditViewInfo = TryCast(checkedComboBoxEdit1.GetViewInfo(), PopupContainerEditViewInfo)
show-super-tooltip-for-disabled-control/VB/ToolTipController/Form1.vb#L71
Dim showArgs As DevExpress.Utils.ToolTipControllerShowEventArgs = ToolTipController.CreateShowArgs()
showArgs.SelectedControl = ActiveButton
showArgs.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip
See Also
ToolTipControllerEventArgsBase Class