DiagramControl.SelectItem(DiagramItem, ModifySelectionMode) Method
In This Article
Selects the specified diagram item.
Namespace: DevExpress.XtraDiagram
Assembly: DevExpress.XtraDiagram.v24.2.dll
NuGet Package: DevExpress.Win.Diagram
#Declaration
public void SelectItem(
DiagramItem item,
ModifySelectionMode modifySelectionMode = ModifySelectionMode.ReplaceSelection
)
#Parameters
Name | Type | Description |
---|---|---|
item | Diagram |
A Diagram |
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
modify |
Modify |
Replace |
A Modify |
#Remarks
The following code sample demonstrates how to use the SelectItem
method to select a newly added shape:
private void button1_Click(object sender, EventArgs e) {
DiagramShape diagramShape = new DiagramShape();
diagramShape.Shape = BasicFlowchartShapes.Decision;
diagramShape.Size = new SizeF(200, 200);
diagramShape.Position = new DevExpress.Utils.PointFloat(450, 300);
diagramControl1.Items.Add(diagramShape);
diagramControl1.SelectItem(diagramShape, ModifySelectionMode.ReplaceSelection);
}
See Also