Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,094 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,627 people online right now. Registration is fast and FREE... Join Now!




RichTextBox related question

 
Reply to this topicStart new topic

RichTextBox related question

cygnusX
13 Oct, 2007 - 02:53 AM
Post #1

D.I.C Head
**

Joined: 19 May, 2007
Posts: 159



Thanked: 2 times
My Contributions
When you move the mouse cursor over hyperlink in some browser the cursor is changed and when you remove it from the hyperlink the cursor is changed to default cursor.Is it possible to have the same functionality in .Net?I'm talking about RichTextBox specifically.I mean if i move the cursor over a certain word i want a different cursor over this word.I've been asking this question in maybe...i don't know,maybe 10 other message boards and doesn't get adequate answer.Is it really impossible?
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: RichTextBox Related Question
13 Oct, 2007 - 04:36 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8600
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Oh Im sure its possible, is it an easy solution, more than likely not, have I had enough coffee to come up with a solution yet, probably not tongue.gif

Its more than likely going to take using Win32 API functions and possible creating your own custom control, and may end up being more trouble than its worth, just my opinion.

Give me some time to drink some coffee first.
User is online!Profile CardPM
+Quote Post

cygnusX
RE: RichTextBox Related Question
12 Nov, 2007 - 10:00 AM
Post #3

D.I.C Head
**

Joined: 19 May, 2007
Posts: 159



Thanked: 2 times
My Contributions
I can do this with custom control based on the RichTextBox.I can put LinkLabels in the RichTextBox

CODE

public void AddText(string text)
        {
            richTextBox1.AppendText(text);
        }

public void AddLinkLabel()
        {
            LinkLabel l = new LinkLabel();
            l.Text = "whatever";
            int charIndex = richTextBox1.Text.Length - 1;
            Point p = richTextBox1.GetPositionFromCharIndex(charIndex);
            l.Location = p;
            l.ForeColor = Color.SteelBlue;
            l.Show();
            richTextBox1.Controls.Add(l);
        }


But the problem is that i don't know how to make the AddText method to add text AFTER the LinkLabel.How to achieve that?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:30PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month