By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

Can't disable double-click in RichTextBox

P: n/a
JT
Hi,

I want to disable the ability to launch an application that is
embedded in the text of a RichTextBox control. I've seen various
posts that say that doing the following will disable click and double-
click processing:

base.SetStyle(ControlStyles.StandardClick, false);

That did not work.

I can't find a way to intercept the event and cancel it, as in
e.Cancel, like you can do in some event handlers. Many people have
complained that they can't get the double-click to work. Well, I
can't stop it from working.

Any clues?

Thanks,

JT

Oct 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Per your request, I've taken a closer look at this thread. Not sure if
you're going to find my input useful at all. But you did ask. :)

JT wrote:
I want to disable the ability to launch an application that is
embedded in the text of a RichTextBox control.
Perhaps you could be more clear about what that means. Maybe for
someone who does RTF stuff all the time it's obvious, but I don't know
how you embed an application in the text of a RichTextBox control.

As is almost always the case, it would be helpful if you could provide a
concise-but-complete example of code that demonstrates the problem
you're having.

My second thought is that I'm not at all clear that disabling
double-clicking is going to be the right way to deal with this. It's
hard to say for sure, since I obviously don't really understand the
original problem anyway. But note that disabling double-clicking
generally for the control means that you not only have prevented some
specific behavior that (for some reason) you don't want, you also wind
up preventing other behavior that users will expect to work correctly.

This goes hand-in-hand with my previous comment about not playing cowboy
with generally accepted rules of UI design. :)

So, it might be worth exploring other ways to disable this behavior,
than the broad-reaching technique of disabling double-clicks altogether.

That said, it sure seems like it should be possible to disable
double-clicks. But without a good example of the situation you're
trying to prevent, it's difficult to comment on what techniques might work.

Pete
Oct 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.