Find dialogbox or Find/replace dialogbox? 
Author Message
 Find dialogbox or Find/replace dialogbox?

HI, all
   I am writing an Editor using C#. Did anyone ever write a method for
Find dialog or Find/Replace dialogbox? If yes, could you please let me
share it?
To add such funtions is my last step for my editor!

Regards!
Jianren



Fri, 19 Nov 2004 21:24:03 GMT  
 Find dialogbox or Find/replace dialogbox?
Hi Jianren,

RichTextBox provides a "Find" method, which is used to search the text in the RichTextBox control for a string at a specific location. You can use it in your Find/Replace
dialog.

As for the Replace functionality, you can either use SelectionStart/SelectionLength properties to implement it yourself or resort to the "Replace" function in the VB
runtime. To do so, you need to add a reference to the Microsoft.VisualBasic namespace.

Also, to make the Find/Replace dialog to be displayed as the top window, simply set the Form.TopLevel property to "true".

Hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:

>Newsgroups: microsoft.public.dotnet.languages.csharp
>Subject: Find dialogbox or Find/replace dialogbox?
>Date: 3 Jun 2002 06:24:03 -0700
>Organization: http://groups.google.com/
>Lines: 8

>NNTP-Posting-Host: 130.153.147.132
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1023110643 6775 127.0.0.1 (3 Jun 2002 13:24:03 GMT)

>NNTP-Posting-Date: 3 Jun 2002 13:24:03 GMT
>Path: cpmsftngxa07!cpmsftngxa10!tkmsftngp01!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!sn-xit-01!sn-xit-06!

sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
Quote:
>Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:65369
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>HI, all
>   I am writing an Editor using C#. Did anyone ever write a method for
>Find dialog or Find/Replace dialogbox? If yes, could you please let me
>share it?
>To add such funtions is my last step for my editor!

>Regards!
>Jianren



Sun, 21 Nov 2004 09:46:41 GMT  
 Find dialogbox or Find/replace dialogbox?
I forgot to say that the String.Replace method do the same tricks as the one in VB runtime.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:
>X-Tomcat-ID: 31330746

>MIME-Version: 1.0
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit

>Organization: Microsoft
>Date: Wed, 05 Jun 2002 01:46:41 GMT
>Subject: RE: Find dialogbox or Find/replace dialogbox?
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>Newsgroups: microsoft.public.dotnet.languages.csharp
>Lines: 49        
>Path: cpmsftngxa07
>Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:65839
>NNTP-Posting-Host: TOMCATIMPORT2 10.201.218.182

>Hi Jianren,

>RichTextBox provides a "Find" method, which is used to search the text in the RichTextBox control for a string at a specific location. You can use it in your
Find/Replace
>dialog.

>As for the Replace functionality, you can either use SelectionStart/SelectionLength properties to implement it yourself or resort to the "Replace" function in the VB
>runtime. To do so, you need to add a reference to the Microsoft.VisualBasic namespace.

>Also, to make the Find/Replace dialog to be displayed as the top window, simply set the Form.TopLevel property to "true".

>Hope this helps.

>Regards,

>Felix Wu
>=============
>This posting is provided "AS IS" with no warranties, and confers no rights.

>--------------------

>>Newsgroups: microsoft.public.dotnet.languages.csharp
>>Subject: Find dialogbox or Find/replace dialogbox?
>>Date: 3 Jun 2002 06:24:03 -0700
>>Organization: http://groups.google.com/
>>Lines: 8

>>NNTP-Posting-Host: 130.153.147.132
>>Content-Type: text/plain; charset=ISO-8859-1
>>Content-Transfer-Encoding: 8bit
>>X-Trace: posting.google.com 1023110643 6775 127.0.0.1 (3 Jun 2002 13:24:03 GMT)

>>NNTP-Posting-Date: 3 Jun 2002 13:24:03 GMT
>>Path: cpmsftngxa07!cpmsftngxa10!tkmsftngp01!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!sn-xit-01!sn-xit-
06!
>sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
>>Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:65369
>>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>>HI, all
>>   I am writing an Editor using C#. Did anyone ever write a method for
>>Find dialog or Find/Replace dialogbox? If yes, could you please let me
>>share it?
>>To add such funtions is my last step for my editor!

>>Regards!
>>Jianren



Sun, 21 Nov 2004 10:01:09 GMT  
 Find dialogbox or Find/replace dialogbox?

Dear Felix,
     Thank you for you help! I think your suggestion is enough for me to
finish writing my editor. I really respect your rich knowledge in
computer program.
     And also I want to know you well. From you name, maybe you are from
China and now work in Microsoft, right?
     I am from China, now I am doing laser research in one university in
Japan. To write some programs by myself is one of my hobbies. Now I am
learning C#, the latest computer program language.

Jianren Lu

-------------------------------------
Institute for Laser Science
University of Electro-communications
1-5-1 Chofugaoka, Chofu, Tokyo 182-8585
Japan

Tel: 81-424-43-5705
FAX: 81-424-85-8960

-------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 21 Nov 2004 10:33:48 GMT  
 Find dialogbox or Find/replace dialogbox?

Dear Felix,

     As you told me, my editor written by C# is close to finish. Only
one thing puzzled me. When I click the find button in my find/replace
dialog, the words can be found, but the text window of RichTextBox
cannot move to the area of slected words. Only the find/replace dialog
is closed, the RichTextBox can move to the seleced area. I want it to
show me the found words the same time with find/replace form on, just
like NotePad does. There should be some setings can relize this
function, could you please tell me?

Best

Jianren

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 21 Nov 2004 17:21:38 GMT  
 Find dialogbox or Find/replace dialogbox?
Jianren,

Have you set the RichTextBox.HideSelection property to "false"? It is "true" by default.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:


>X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
>Subject: RE: Find dialogbox or Find/replace dialogbox?
>Mime-Version: 1.0
>Content-Type: text/plain; charset="us-ascii"
>Content-Transfer-Encoding: 7bit

>Newsgroups: microsoft.public.dotnet.languages.csharp
>Date: Wed, 05 Jun 2002 02:21:38 -0700
>NNTP-Posting-Host: actionjackson37.dsl.frii.net 216.17.146.37
>Lines: 1        
>Path: cpmsftngxa08!tkmsftngp01!tkmsftngp04
>Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:65710
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>Dear Felix,

>     As you told me, my editor written by C# is close to finish. Only
>one thing puzzled me. When I click the find button in my find/replace
>dialog, the words can be found, but the text window of RichTextBox
>cannot move to the area of slected words. Only the find/replace dialog
>is closed, the RichTextBox can move to the seleced area. I want it to
>show me the found words the same time with find/replace form on, just
>like NotePad does. There should be some setings can relize this
>function, could you please tell me?

>Best

>Jianren

>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!



Sun, 21 Nov 2004 17:55:31 GMT  
 Find dialogbox or Find/replace dialogbox?

Felix,
  even I set RichTextBox.HideSelection true, it doesn't work. The
problem seems like the relationship between the main form and
find/replace dialog form. Now, after click find button, only I click the
main form or close the find dialog, the found text can appear in window.

Jianren

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 21 Nov 2004 19:37:42 GMT  
 Find dialogbox or Find/replace dialogbox?

Yes, It works.
I made a misunderstanding of hideslection
thank you for you help!
jianren

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 21 Nov 2004 23:01:59 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Find a control type base on it's ID in dialogbox

2. Tranfer of data from an edit box in one dialogbox to a listbox in another dialogbox

3. Find and Replace, Not Find and Overwrite

4. Find and Find/Replace

5. how do i replace a login dialogbox

6. Find/Replace in vs.NET

7. Find/Replace

8. Find and replace

9. Find and Replace algorithm?

10. string find and replace

11. C++ Find & Replace function

12. DevStudio multiple-file find/replace??

 

 
Powered by phpBB® Forum Software