Moving a textbox

G

Guest

I have some custom controls and a multiline textbox inside a form and I want to let the user move all controls using the stylus (PocketPC). The user doesn't need to edit the text, but I need the vertical scroll (wordwrap is true and scrollbars set to vertical). Lets assume textbox is readonly (although I used the GotFocus trick to have a white background but a readonly functionality, but I can live with gray background)
Handling MouseDown, MouseMove and MouseUp in the form, I can move my custom controls, but not the textbox. The textbox is eating the message. Trying to capture MouseDown on textbox doesn't work either. I also played a little with deriving from TextBox or TextBoxBase, but it didn't help
Using a label is not an option since I need vertical scroll
Do you have any ideas that might work? I'd hate to write another control to do this, especially with the scroll and measuring the multiline text ..
Thanks
 
A

Alex Yakhnin [MVP]

You can try to use ApplicationEx for that. You'd just need to setup the
appropriate MessageFilter.

http://www.opennetcf.org/PermaLink.aspx?guid=3a013afd-791e-45ef-802a-4c1dbe1cfef9

--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

Gabriel B said:
I have some custom controls and a multiline textbox inside a form and I
want to let the user move all controls using the stylus (PocketPC). The user
doesn't need to edit the text, but I need the vertical scroll (wordwrap is
true and scrollbars set to vertical). Lets assume textbox is readonly
(although I used the GotFocus trick to have a white background but a
readonly functionality, but I can live with gray background).
Handling MouseDown, MouseMove and MouseUp in the form, I can move my
custom controls, but not the textbox. The textbox is eating the message.
Trying to capture MouseDown on textbox doesn't work either. I also played a
little with deriving from TextBox or TextBoxBase, but it didn't help.
Using a label is not an option since I need vertical scroll.
Do you have any ideas that might work? I'd hate to write another control
to do this, especially with the scroll and measuring the multiline text ...
 
G

Guest

Thanks! Following your suggestion and inspired by the great work from OpenNETCF, I implemented my own message loop and filtered some messages

----- Alex Yakhnin [MVP] wrote: ----


You can try to use ApplicationEx for that. You'd just need to setup th
appropriate MessageFilter

http://www.opennetcf.org/PermaLink.aspx?guid=3a013afd-791e-45ef-802a-4c1dbe1cfef

-
Alex Yakhnin .NET CF MV
www.intelliprog.com | www.opennetcf.or

Gabriel B said:
I have some custom controls and a multiline textbox inside a form and
want to let the user move all controls using the stylus (PocketPC). The use
doesn't need to edit the text, but I need the vertical scroll (wordwrap i
true and scrollbars set to vertical). Lets assume textbox is readonl
(although I used the GotFocus trick to have a white background but
readonly functionality, but I can live with gray background)
Handling MouseDown, MouseMove and MouseUp in the form, I can move m
custom controls, but not the textbox. The textbox is eating the message
Trying to capture MouseDown on textbox doesn't work either. I also played
little with deriving from TextBox or TextBoxBase, but it didn't help
Using a label is not an option since I need vertical scroll
Do you have any ideas that might work? I'd hate to write another contro
to do this, especially with the scroll and measuring the multiline text ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top