Trigger mousedown in derived TextBox from code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am wondering if someone knows how to trigger a mousdown event in a TextBox
from code as if someone clicked the textbox.

I have tried to derive a TextBox and manualy call the RaiseMouseEvent metod
whith a propper MouseEventArgs, but this doesnt work the way I want. The
thing is that tre text cursor doesn´t get positioned in the textboxs text
acording to the click event coordinates. it allways gets positioned first in
the textboxs text.

Does someone know a way to do this?

Thanx!

Peter
 
Hi,

Well, the thing is that i am developing a propertygrid (kind of) using the
Syncfusion GridControl. The thing is that the Grid Control catches the focus
on the first mouse click. This means that i have to click twice on the
textbox to focus it and place the text cursor where i want in the text. Wich
is where i clicked.

There is no way around it exept handeling the click event that the Grid
catches and passing it on to the textbox. So this is kind of what i am trying
to do.

/Peter





I have
 
Hi Peter,

I don't think that firing the mousedown event will work for you, the
only thing that happens when you fire the event is that any event
handlers attached to the event will fire, that's all no change will
happen in the control. Instead a better way would be to send a window
message to the control.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
 
Back
Top