Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I was referring to your modified script. I think I found the problem. When you set CurrentCell it changes the selection. In your version of the function you can comment out the CurrentCell portion and make sure you start the search from the last item in the selection:
It shows the same result. I've the following bit of code Selection Changed event to show a message box whenever the selection change occurs. Basically it's not triggering the Selection Changed event.
The selection will not change if the next found cell is in the same row and you have whole row selection enabled. In other words, the selection will only change if the selected cell is in a different row.
If you don’t want to search for multiple matches within the same row, then you will have to start the search using the last cell of the current selection.
davidc wrote:The selection will not change if the next found cell is in the same row and you have whole row selection enabled. In other words, the selection will only change if the selected cell is in a different row.
I now understand.
davidc wrote:If you don’t want to search for multiple matches within the same row, then you will have to start the search using the last cell of the current selection.
I finally resolved the issue by moving my code snippet from SelectionChanged event to CurrentCellChanged event.
From MSDN documentation:When you change the value of this property, the SelectionChanged event occurs before the CurrentCellChanged event. Any SelectionChanged event handler accessing the CurrentCell property at this time will get its previous value.
This topic is 11 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.