Combobox

  • Thread starter Thread starter Ferdinand Zaubzer
  • Start date Start date
F

Ferdinand Zaubzer

Hello,

I am trying to insert some Text via drag and drop into the editable
area of a combobox.
The problem is, that I can't get the current charIndex of the selected
Text via the mouse cursor location.
Is there any way to do that or is it not possible?

Thanks
Ferdinand
 
TextBox has methods like GetCharIndexFromPosition exposed that would
let you find the index under the mouse in TextBox. (You would have to
call textBox.PointToClient on the screen point passed in by the D&D
event args to make sure the point is in the TextBox coordiante
system).

But ComboBox does not appear to expose such a method. You could try
using a 'ghost' TextBox set up in a similar manner, size and font as
your combobox (but positioned offscreen so it is not visible). Then
maybe you could pass in the client position from the combobox to the
textbox.GetCharIndexFromPosition function to approximate the position
in the combobox.

================
Clay Burch
Syncfusion, Inc.
 
Back
Top