Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Trigger mousedown in derived TextBox from code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Erikson - 01 Oct 2004 17:21 GMT
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
Sijin Joseph - 01 Oct 2004 17:39 GMT
What is the general problem you are trying to solve, maybe there is a
better way?

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

> Hi,
>
[quoted text clipped - 12 lines]
>
> Peter
Peter Erikson - 01 Oct 2004 19:45 GMT
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

> What is the general problem you are trying to solve, maybe there is a
> better way?
[quoted text clipped - 19 lines]
> >
> > Peter
Sijin Joseph - 02 Oct 2004 13:15 GMT
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

> Hi,
>
[quoted text clipped - 35 lines]
>>>
>>>Peter
Peter Erikson - 03 Oct 2004 10:03 GMT
OK, i will look in to this.

thanx for the info.

/Peter

> Hi Peter,
>
[quoted text clipped - 47 lines]
> >>>
> >>>Peter

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.