Article View: borland.public.csharpbuilder.winforms.controls.using
Article #6Re: 'Trapping' a double-click in RichTextEdit Mouse-down event
From: John Fowler
Date: Fri, 11 Mar 2005 04:13
Date: Fri, 11 Mar 2005 04:13
41 lines
2182 bytes
2182 bytes
Hi, Marc:
I've tried this, but when I double-click within the rich text edit (called 'rtBox' in my code) it does nothing (except the default behaviour, i.e. it high-lights the text in the editbox):
Declaration:
this.rtBox.DoubleClick += new System.EventHandler(this.rtBox_DoubleClick);
private void rtBox_DoubleClick(object sender, System.EventArgs e)
{
string [] text_to_insert = { rtBox.Text };
}
What am I missing?
Thanks, again, for your help! it's much appreciated....
John F.
"Marc Rohloff [TeamB]" <"on request"> wrote:
>On 9 Mar 2005 22:40:24 -0800, John Fowler wrote:
>
>> I have a rich text editbox on a form and when I double-click it, I
>> want its text to be copied to myString. However, the program alwaly
>> 'freezes' after the FIRST click; thus e.Clicks == 1 is always true
>> and I can never click fast enough for e.Clicks ever to be '2'.
>
>> private void rtBox_MouseDown(object sender,
>> system.Windows.Forms.MouseEventArgs e)
>
>Why don't you use the double click event? You can't get at it in the
>designer but it is easy enough to set in code:
>
>this.richTextBox1.DoubleClick += new
>System.EventHandler(this.textBox1_DoubleClick);
>
>--
>Marc Rohloff [TeamB]
>marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID:
<42311afd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<422febd8$1@newsgroups.borland.com> <i3mrg7bj7oqe.dlg@marcrohloff.40tude.net>Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff3c,eb5671884cadb4e5 X-Google-Attributes: gid1eff3c,public X-Google-Language: ENGLISH,ASCII-7-bit From: "John Fowler" <jfowler@pol.net> Sender: "John Fowler" <jfowler@pol.net> Reply-To: "John Fowler" <jfowler@pol.net> Subject: Re: 'Trapping' a double-click in RichTextEdit Mouse-down event Newsgroups: borland.public.csharpbuilder.winforms.controls.using X-User-Info: 24.20.189.226 References: <422febd8$1@newsgroups.borland.com> <i3mrg7bj7oqe.dlg@marcrohloff.40tude.net> NNTP-Posting-Host: 207.105.83.66 Message-ID: <42311afd$1@newsgroups.borland.com> Date: 10 Mar 2005 20:13:49 -0800 X-Trace: newsgroups.borland.com 1110514429 207.105.83.66 (10 Mar 2005 20:13:49 -0800) Lines: 42 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail