brideas Posted February 2, 2004 Posted February 2, 2004 I hope someone could help me with this problem: I am trying to write a program in which when you type a character in a RichTextBox control, I want it to display a context menu just to the right of that. The user would then select what they want from the context menu and that would be inserted into the text box at the location of the cursor. I dont know how to return the cursor location and use it to place the context menu there and how to insert text at the specific cursor location. Any help is greatly appreciated. Thank you! Quote
*Experts* Bucky Posted February 2, 2004 *Experts* Posted February 2, 2004 You do not need to know the cursor's position to show the ContextMenu, just set the ContextMenu property of the RTB to your menu and it will pop up when the user right-clicks the control. As for the caret location, utilize the SelectionStart, SelectionLength, and SelectedText properties in your code. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.