Code:
public Point getXYPoints()
{
// Get current caret position point from CCRichTextBox
Point pt = this.GetPositionFromCharIndex(this.SelectionStart);
// Increase the Y-coordinate size by 10 & Font size of CCRichTextBox
pt.Y = pt.Y + (int)this.Font.Size + 10;
// Check if the Y-coordinate value is greater than CCRichTextBox Height - CodeCompleteBox
// for adding CodeCompleteBox at the Bottom of CCRichTextBox
if (pt.Y > this.Height - CodeCompleteBox.Height)
{
pt.Y = pt.Y - CodeCompleteBox.Height - (int)this.Font.Size - 10;
}
return pt;
}