Find And Replace in VB2005 compared to VB6

J Trahair

Well-known member
Joined
May 14, 2008
Messages
175
Location
Spain
Programming Experience
10+
First, apologies if you've 'done' comparisons with VB6, but some of us are just catching up.

The behaviour of the 'Find And Replace' tool (VB2005): in old VB6, if I want to find all occurrences of (for example)
HTML:
mstrThisString = ""
in all forms, it would start somewhere and go through until the whole project had been searched. If you stopped the Find to change something, it would start afresh from that point and search through the project normally,without repeating or back-tracking.

In VB2005, if you stop the Find in (for example) the frmInvoicing form at the fifth occurrence to change something, what happens is this:
you restart the Find cycle, you're in frmInvoicing at the fifth occurrence, so it finds occurrences 6 then 7 (the last in this form), then starts again at the top of frmInvoicing!!. I'd expect to move to the next form. Consequently I don't know where I am.

Is there a setting I can change to improve this?

Thank you.
 
Yes, I know about the Look In combobox. Whichever setting the Look In is set to (in my example it was Entire Solution), the behaviour of the Find routine is less than predictable, and certainly not what VB6 does.

Perhaps this is another of Microsoft's improvements that I shall have to live with.
 
Yes, I know about the Look In combobox. Whichever setting the Look In is set to (in my example it was Entire Solution), the behaviour of the Find routine is less than predictable, and certainly not what VB6 does.

Perhaps this is another of Microsoft's improvements that I shall have to live with.
The fact that the behaviour of the Find & Replace tool is not what you're used to does not mean that it's unpredictable. It's completely predictable. Personally, I find the current implementation more sensible than what you're describing, although that doesn't mean what was was wrong. That said, if you change what you're looking for then it makes sense to treat it as a new search and ignore whatever went before. Whatever seems more intuitive to the individual, what is is and, as far as I can see, there's no way to make VS.NET behave the way you describe.
 
Back
Top