RightClick
RightClick() Event
Called when the button is right-clicked
Applies to: Button , Grid , Picture Button , Rich Edit
RightClick() Event
Right click
Applies to: Tree
Introduced in KCML version 5.02
RightClick() Event
Right click on graph data
Applies to: Graph
Introduced in KCML version 6.00
This event is called if the user right clicks on a suitable control. Graphs and trees also have a NoItemRightClick() event for clicks outside the graph or tree.
In the case of grids, the event is only signalled if the RightAction property is set appropriately.
This event handler is commonly used to activate grid cell editing by calling either the EditCell(), EditGrid(), or EditRow() methods, for example:
- DEFEVENT Form1.GridControl1.RightClick() ..EditGrid(..CursorRow, ..CursorCol) END EVENT
Note that this event can also be used to display popup menus by calling the TrackPopup() method. Use the MouseX and MouseY properties to position the popup menu at the point on the control surface the click occurred. for example:
- DEFEVENT Form1.gridControl1.RightClick() .menu1.TrackPopup(..MouseX + ..Left, ..MouseY + ..Top) END EVENT
With trees the Index property is available within this event handler to determine the item which was clicked by the the user. For example, the following could be used to return the text associated with the item that the user selected:
SelItem$ = ..Item(..Index).Text$
For graphs the data set and index for the selected element are found in ClickSet and ClickIndex and allow the programmer to take an action based on the element clicked such as bring up further information or drilling down into the data.
If the user clicks on a legend item, the values returned will depend on whether the graph has a singal or mutliple sets of data. On a single set graph, each legend represents a data item, so the ClickSet will be the single set of the graph and the ClickIndex wil be the item of the legend. On a multiple set graph, each legend item represents a data set, so the ClickSet will be the legend clicked and the ClickIndex will be 0 as no particular item is accessed. On pie charts elements may be highlighted using the Explode() method.