|
-
Sep 21st, 2007, 04:14 AM
#1
Thread Starter
PowerPoster
[RESOLVED] [2005] Intellisense copy within Application
All,
I'm trying to implement a similar kind of thing to the intellisense in the .Net ide. My users can add dynamic content, when they are typing in a richtextbox if they press a certain key the intellisense window should pop up next to where they are typing in the textbox. This is fairly straight forward to trap the keys but positioning the new window is a bit of a issue, any thoughts?
Thanks
-
Sep 21st, 2007, 04:41 AM
#2
Re: [2005] Intellisense copy within Application
If there is not a class that can tell you the cordinate of a string inside a textbox then i guess you may count the lenght of the textbox and then count the number of characters inside it. Then you must calculate how much space does a character take in the textbox and add it to the final lenght. You got one coordinate from the Vertical axis of the textbox. The other one will be the start of the form till the start of the textbox + the counted characters length.The final lenght is the cordinate for popping up the intelli.
Just a thought.
-
Sep 21st, 2007, 05:23 AM
#3
Thread Starter
PowerPoster
Re: [2005] Intellisense copy within Application
Thanks, I had worked out that that would be possible to do but seems very long winded. Was wondering if there was something that could point me to the distance the cursor is from the top of the RTB
Thanks
-
Sep 21st, 2007, 05:31 AM
#4
Re: [2005] Intellisense copy within Application
You can get maybe the cursor.position and compare it with the textbox point.
-
Sep 21st, 2007, 06:25 AM
#5
Re: [2005] Intellisense copy within Application
This line of code will return the position of the character next to the input caret.
VB Code:
RichTextBox1.GetPositionFromCharIndex(RichTextBox1.SelectionStart)
Should be close enough?
-
Sep 21st, 2007, 07:50 AM
#6
Thread Starter
PowerPoster
Re: [2005] Intellisense copy within Application
Awesome,
Just what I needed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|