GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Jul-2005, 15:09
Automatik Automatik is offline
New Member
 
Join Date: May 2005
Posts: 21
Automatik is on a distinguished road

C# Line Over Textbox


How can I make it so that this line is drawn over the RichTextBox that is on the Form?

I am drawing a line when a user right clicks like this:
C-SHARP / C# Code:
if(e.Button.ToString() == "Right")
{
        Graphics g = this.CreateGraphics();
	Pen p = new Pen(System.Drawing.Color.Black,8);
	g.DrawLine(p,e.X,0,e.X,this.Height);
	this.textBox1.SendToBack();
}
  #2  
Old 20-Jul-2005, 16:05
Automatik Automatik is offline
New Member
 
Join Date: May 2005
Posts: 21
Automatik is on a distinguished road
Already figured it out...

Let me know if you want/need solution...
  #3  
Old 21-Jul-2005, 00:56
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 889
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Automatik
Already figured it out...

Let me know if you want/need solution...

We encourage members to post the solutions they find if no reply has been given. So, if possible, a solution would be great!

Thanks,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #4  
Old 21-Jul-2005, 08:06
Automatik Automatik is offline
New Member
 
Join Date: May 2005
Posts: 21
Automatik is on a distinguished road
Quote:
Originally Posted by LuciWiz
We encourage members to post the solutions they find if no reply has been given. So, if possible, a solution would be great!

Thanks,
Lucian

Sorry about that...

To fix this I created the graphics object for the textbox not for the form.

C-SHARP / C# Code:
  Graphics g2 = this.textbox1.CreateGraphics();
  #5  
Old 21-Jul-2005, 08:15
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 889
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Automatik
Sorry about that...

To fix this I created the graphics object for the textbox not for the form.

C-SHARP / C# Code:
Graphics g2 = this.textbox1.CreateGraphics();

To be honest, just now I understood what you were asking!
Thanks, I appreciate it.

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #6  
Old 22-Feb-2008, 06:18
AbhishekAgrawal AbhishekAgrawal is offline
New Member
 
Join Date: Feb 2008
Posts: 1
AbhishekAgrawal is on a distinguished road

Re: C# Line Over Textbox


Hi,

I was trying to draw lines on richtextbox but when i scroll or do something else, the lines goes away. Any idea how to draw permanent lines??
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD Burner Help - Power Calibration Error.... JonBoy420 Computer Hardware Forum 111 17-Apr-2008 15:58
burning problems PLEASE PLEASE HELP kelticeire Computer Hardware Forum 4 01-Dec-2006 15:39
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 03:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:25.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.