This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Im trying to use the selected elements property of the diagram surface, but i dont seem to have it quite right. Im using the extended selection mode of the diagram surface, and selecting nodes by holding down the shift key, then selecting them individually. The problem is that the selected elements collection never holds more than the most recent element. I can click on one node, and it is added to the selected elements collection. When the next node is clicked, the selected elements now contains my new node, but not the originally selected one. On the diagram, both elements are shown as being selected (they both have the move handles around them). I suspect im missing something along the line, so any help would be greatly appreciated. Ive attached an example of my code if it helps at all:
private void OnSelectChange(object sender, EventArgs e) foreach(DiagramElement dElement in dElements) if (dElement is DiagramConnectionElement) sb.Clear(); |
|
|
Hello Richard I have not been able to reproduce this behaviour. Holding down the Shift button while selecting nodes is not designed to keep the previous selections in the collection. The Ctrl button however does do this. So the logical behaviour that you are seeing is correct. But the move handles still being visible is incorrect. This may be due to a broken custom style. If you are unable to find what is causing this, please send a repro project that I can debug. To clarify: Holding the Ctrl key will add/remove nodes from the selection, holding down Shift will clear the selection before adding the clicked node to the collection. - Jason |
|
|
Brilliant, thanks for your help, turns out the problem was elsewhere in my code... |
|