OT: C# help for Query Express

OT: C# help for Query Express

Old forum URL: forums.lhotka.net/forums/t/7498.aspx


Q Johnson posted on Monday, August 24, 2009

If you use Query Express, I needn't say more about what a terrific little utility this is. If you don't, get out to http://www.albahari.com/queryexpress.aspx and download all 124 K of it and get aquainted in about 2 minutes. It's a free Query Analyzer/SSMS work-alike. It's really strong, too. I've even built SQL with Cursors there.

Since the source code is available and I spend some time in the program, I decided to try and add Search and Replace capability.

Much to my chagrin, it's in C#. I've built the dialog and the S/R functionality by adding a VB project and all I need now is for some generous soul to provide the code for the main window textbox's KeyDown event. I can't even FIND the code, much less modify it. It's as if a C# textbox HAS no Key events to me!

My VB dialog (frmSearchReplace) has a public string property, QueryText. I need the KeyDown event to check that the keystroke was Cntl-H and, if so, to send the entire contents of its .Text property to me by assigning it to that property and then, to GET that property value and use it to re-set its own .Text property with my changes.

I guess it would be great if it honored Selected Text, too. But my dialog isn't going to care one way or the other. It will just make the changes to whatever text it's provided.

If I could find the event, I think I could limp through building my first C# code, but how long could this take YOU? Fifteen minutes?

If you think it's a good idea, I'll put the finished product out at Source Forge for everyone to enjoy.

Any takers? Thanks in advance.

Copyright (c) Marimer LLC