[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
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.
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
Re: [2005] Intellisense copy within Application
You can get maybe the cursor.position and compare it with the textbox point.
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?
Re: [2005] Intellisense copy within Application
Awesome,
Just what I needed