473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

richtextbox problems c#

Hi all,
im writing a program in C#, but i'm having a couple of problems with a richtextbox i have on my form. Firstly, I want a user to be able highlight a certain part of a line, but at the moment when i do this the whole line gets highlighted. Secondly, when i rightclick inside the richtextbox, no menu gets displayed (i.e. to paste in some text - i dont want to just use ctrl-v). Is there something i can do about this.
Thanks in advance for any help.
Mootroot
Mar 29 '08 #1
1 1514
balabaster
797 Expert 512MB
Hi all,
im writing a program in C#, but i'm having a couple of problems with a richtextbox i have on my form. Firstly, I want a user to be able highlight a certain part of a line, but at the moment when i do this the whole line gets highlighted. Secondly, when i rightclick inside the richtextbox, no menu gets displayed (i.e. to paste in some text - i dont want to just use ctrl-v). Is there something i can do about this.
Thanks in advance for any help.
Mootroot
Um...in relation to the fact the the user needs to be able to highlight a certain part of a line, that's a standard feature of the RichTextBox object, so if you're not able to do that, then you've likely got other code that's negating this somewhere.

In relation to the context menu add a ContextMenuStrip to your form that contains the item "Paste" and write the code to do what you want when you click Paste in the click event of that menu item. Then assign the context menu to your RichTextBox by selecting it in the ContextMenuStrip property.
Mar 29 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Frank White | last post by:
I noticed what I thought was peculiar behavior when I used the RichTextBox. If you get the RTF string from a RichTextBox using the RichTextBox.Rtf property, the RichTextBox treats this as an action...
11
by: Mad Joe | last post by:
I'm using a richTextBox for editing a source code (with Syntax Highlighting) of my own programming language... How come that myRichTextBox doesn't respond to Undo/Redo functions by using default...
2
by: Reinhard Vornholt | last post by:
Hi, I have problems with the Windows.Forms.RichtextBox Control of the VS. I have a text that is written with WordPad. In this text there are tables. The cells in the tables are holding multiple...
2
by: Alan | last post by:
Hi all, I want to hilight some syntax keywords. While parsing text, I used these properties such as SelectionStart,SelectionLength and SelectionColor of RichTextBox. Although the syntaxhilghting...
1
by: vertigo | last post by:
Hello I have some Threads, and they write something to RichTextBox.Text property. But sometimes i receive error: ************** Exception Text ************** System.NullReferenceException:...
8
by: Dennis | last post by:
How can I tell if the Insert Mode is on or off? -- Dennis in Houston
2
by: Ludwig | last post by:
Hi, thanks to the insight that Kevin Spencer gave me concerning my regular expressions question from a few days ago, I managed to create a first version of my (free) Highlighter RichTextBox...
0
by: Tom | last post by:
When I use ctrl-c to copy and ctrl-v to paste from a RichTextBox into NotePad ... I get nice ASCII text with the proper returns. Everything looks good. When I paste into WordPad ... I get the...
2
by: macky caliston | last post by:
Hi, Im having problems with the value being returned by the richtextbox.GetLineFromCharIndex method. Its returning a value that is more than the richtextbox.Lines.Length. Im trying to print...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.