Jump to content
  • Advertisement
Sign in to follow this  
chrisliando

[.net] How to display active cursor on 2 textBoxes at the same time?

This topic is 3786 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using Visual C++ Express Edition 2005. How to display active cursor/caret on 2 textBoxes at the same time? The purpose is so that user can insert / append text from textBox Source to textBox Target without to move from one side to another. Thank you very much..

Share this post


Link to post
Share on other sites
Advertisement
You cant. But you can use Control.Focus to move between the two controls however which way you want. Obviously you don't want it jumping back and forth otherwise input will appear randomly in each textbox. You will need some sort of method to control which textbox should receive input.

I'm not really sure what your trying to achieve since you don't explain it in much detail. But if you want textbox1 to also place input into textbox2, then in the TextChanged event for textbox1 just copy the textbox1.Text into textbox2.Text.

Share this post


Link to post
Share on other sites
You could presumably send fake WM_SETFOCUS messages to the two boxes. There'd still be only one which actually got keyboard input, though.

Share this post


Link to post
Share on other sites
It's my senior who asked me to make thing like that.

When I heard that, I also confused if it is possible to be implemented.

The details of my application is like this:

I have 2 textBoxes, Target and Source. There are also 2 buttons: Append and Insert.

If I click Append, the selected text on Source will be appended to the end of Target. If I click Insert, the selected text on Source will be inserted to the ACTIVE CURSOR OF TARGET OR REPLACE THE SELECTED TEXT ON TARGET.

So that's why my Senior wants me to display active cursor on both textBoxes.

How to do that?

Thank you very much..

Share this post


Link to post
Share on other sites
I don't have my IDE or MSDN open right now, but isn't there some sort of ContentChanged event handler on the textbox? As soon as the content of the text box changes, you could copy those changes over to the second textbox accordingly.

Share this post


Link to post
Share on other sites
You mean TextChanged? I have successfully done the part of Insert and Append.

The only part that has not been finished is to show the active cursors on both textBoxes.

How to do that?

Thank you very much..

Share this post


Link to post
Share on other sites
As Headkaze said, you can't. Only one control can be active at a time. If whoever is telling you otherwise can show how it can be done, I'd like to see it.

Share this post


Link to post
Share on other sites
I agree with you...That's why I am now confused thinking how to do that..I think he has done it successfully so that he could told me to do the same thing.

Are you sure you haven't heard something like this before?

I'll tell you how to do that if I have been successfull..

Thank you very much.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!