Hi!

I created a FindDialog for RichTextBox.

I have 2 problem with it:
- when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
stop displaying its current selection (it apparently need the focus to draw
it), so when the user click "Find Next" I select the next match, but the
user has no visual feedback :-/

- I also try the RichTextBoxFins.Reverse option, doesn't seems to work at
all!

Any ideas?

--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.

Re: FindDialog for RichTextBox problem by Lloyd

Lloyd
Sat Sep 17 05:19:21 CDT 2005

Ok, problem 1 solved:
HideSelection = false;

still problem 2 remains, RichTextBoxFins.Reverse doesn't seems to works
much...

--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.
"Lloyd Dupont" <ld@NewsAccount.galador.net> wrote in message
news:O3oGqD3uFHA.3720@TK2MSFTNGP14.phx.gbl...
> Hi!
>
> I created a FindDialog for RichTextBox.
>
> I have 2 problem with it:
> - when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
> stop displaying its current selection (it apparently need the focus to
> draw it), so when the user click "Find Next" I select the next match, but
> the user has no visual feedback :-/
>
> - I also try the RichTextBoxFins.Reverse option, doesn't seems to work at
> all!
>
> Any ideas?
>
> --
> If you're in a war, instead of throwing a hand grenade at the enemy, throw
> one of those small pumpkins. Maybe it'll make everyone think how stupid
> war is, and while they are thinking, you can throw a real grenade at them.
> Jack Handey.
>



Re: FindDialog for RichTextBox problem by Lloyd

Lloyd
Sat Sep 17 05:29:13 CDT 2005

problem 2 solved:
public void Find(RichTextBox rtb)
{
if (rtb == null || Text == null || Text.Length == 0)
return;

int start, end;
if ((Option & RichTextBoxFinds.Reverse) == 0)
{
start = rtb.SelectionStart+1;
end = rtb.TextLength;
}
else
{
end = rtb.SelectionStart;
start = 0;
}

int offset = rtb.Find(Text, start, end, Option);
if (offset > -1)
rtb.Select(offset, Text.Length);
}


--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.
"Lloyd Dupont" <ld@NewsAccount.galador.net> wrote in message
news:O3oGqD3uFHA.3720@TK2MSFTNGP14.phx.gbl...
> Hi!
>
> I created a FindDialog for RichTextBox.
>
> I have 2 problem with it:
> - when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
> stop displaying its current selection (it apparently need the focus to
> draw it), so when the user click "Find Next" I select the next match, but
> the user has no visual feedback :-/
>
> - I also try the RichTextBoxFins.Reverse option, doesn't seems to work at
> all!
>
> Any ideas?
>
> --
> If you're in a war, instead of throwing a hand grenade at the enemy, throw
> one of those small pumpkins. Maybe it'll make everyone think how stupid
> war is, and while they are thinking, you can throw a real grenade at them.
> Jack Handey.
>



Re: FindDialog for RichTextBox problem by Herfried

Herfried
Sat Sep 17 06:03:12 CDT 2005

"Lloyd Dupont" <ld@NewsAccount.galador.net> schrieb:
> I created a FindDialog for RichTextBox.
>
> I have 2 problem with it:
> - when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
> stop displaying its current selection (it apparently need the focus to
> draw it), so when the user click "Find Next" I select the next match, but
> the user has no visual feedback :-/

Set the control's 'HideSelection' property to 'False'. If you want the find
dialog to be shown in a way that it doesn't prevent the user from accessing
the richtextbox, use the code below:

\\\
Dim f As New FindDialog()
f.Owner = Me
f.Show()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: FindDialog for RichTextBox problem by Lloyd

Lloyd
Sat Sep 17 20:44:56 CDT 2005

Menu => View => Current View => Group Message By Conversation

it was already solved! ;-)
but thanks!

--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%23oqnad3uFHA.3688@tk2msftngp13.phx.gbl...
> "Lloyd Dupont" <ld@NewsAccount.galador.net> schrieb:
>> I created a FindDialog for RichTextBox.
>>
>> I have 2 problem with it:
>> - when I ShowDialog() my FindDialog, it got the focus and the RichTextBox
>> stop displaying its current selection (it apparently need the focus to
>> draw it), so when the user click "Find Next" I select the next match, but
>> the user has no visual feedback :-/
>
> Set the control's 'HideSelection' property to 'False'. If you want the
> find dialog to be shown in a way that it doesn't prevent the user from
> accessing the richtextbox, use the code below:
>
> \\\
> Dim f As New FindDialog()
> f.Owner = Me
> f.Show()
> ///
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>