How to Open "File And Replace" Dialog Box ?Posted by Eswaran Radhakrishnan
|
Hi all, |
Breaking News Sisulizer 2010 improves machine translation of software
|
|
See this to Open Find And ReplaceSujit Patil
|
The find subroutine is pretty straight forward, it will search the entire document for the first occurrence of the search term defined by the user on the form. It will search in one of two ways: With or without matching the case of the search term. Depending upon whether or not the user has checked the Match Case check box on the form, the application will search for the text using either the binary or text compare method. With the binary method, the search term must match exactly (including case), with the text compare method, the strings just need to match. The "StartPosition" integer value is set to the value returned by from the InStr call; InStr is passed the starting position of 1, the entire body of text contained in the rich text box control (as the article to search), the search term entered by the user, and the search compare method). InStr will return the index position of the found text if the text is in fact found, if nothing is found, it will return a zero. If the starting position value is zero, the user will be notified that the search term was not found, else, the application will highlight the found text in the document, pan to its location, and set the focus back to the main form (which in turn makes the highlighting visible to the user).
private
{
MessageBoxButtons
}
The find next function works in a manner consistent with the find function; the only difference is that it sets the start position to the current position of the selection starting point within the document so that the find next function will not start at the beginning of the document each time it searches:
private
{
MessageBoxButtons
}
The replace subroutine is quite simple, it merely tests to see if any text is selected and, if it is, it replaces with the replacement text entered into the form by the user, it then moves to the next occurrence of the search term if one exists:
private
{
MessageBoxButtons
}
The replace all function is a little different in that it uses a the replace method to replace every instance of the search term with the replacement term throughout the entire body of text:
private
{
(txtReplacementText.Text));
}
Again, the frmFind.cs class is the same as the replace class with the exception being that it does not support the replace and replace all methods.
See this for more details;
http://www.c-sharpcorner.com/UploadFile/scottlysle/WordProcessor02042007234628PM/WordProcessor.aspx
Best Luck!!!!!!!!!!!!! |
hi Eswaran.
pravin kumar S
replied to Eswaran Radhakrishnan
01-Aug-08 08:40 AM
|
reply
Binny ch
replied to Eswaran Radhakrishnan
01-Aug-08 09:47 AM
|