Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Intellisense copy within Application

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Resolved [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

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    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.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    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

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: [2005] Intellisense copy within Application

    You can get maybe the cursor.position and compare it with the textbox point.

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2005] Intellisense copy within Application

    This line of code will return the position of the character next to the input caret.
    VB Code:
    1. RichTextBox1.GetPositionFromCharIndex(RichTextBox1.SelectionStart)
    Should be close enough?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    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
  •  



Click Here to Expand Forum to Full Width