1 Replies - 3016 Views - Last Post: 01 April 2012 - 09:00 PM

#1 JohnBoyMan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 24-February 12

textbox selected or not?

Posted 01 April 2012 - 06:52 PM

Hello. I have a unique situation. I have so many text box's that i wound up making a text box array. Now each text box i make i have to give it a mouse clicked event and mouse moved event. I cannot write these event functions for all of the text box's there would be too many. So i thaught i could just find out what text box has been clicked then in the events function iterate through the array of text box's and find out which one has been selected or not.

You might not have understood what im doing , but im simply looking for a textbox's selected variable. Its likely bool. I know check box's have a Checked value. It looks like this


this->checkbox1->Checked=true;




I need somthing like that but for a textbox, that will tell me weather or not it has been clikced on and highlighted. thanks all.

Is This A Good Question/Topic? 0
  • +

Replies To: textbox selected or not?

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,355
  • Joined: 02-June 10

Re: textbox selected or not?

Posted 01 April 2012 - 09:00 PM

Quote

tell me weather or not it has been clikced on and highlighted.




I'm out of my element in C++ but...

I don't think you have to care about whether or not it was clicked on since you do care about text being selected (highlighted). The text being selected it your key to which textbox is in use.

Couldn't you just iterate through you array of textboxes and check what the SelectionLength is? Whichever textbox has a SelectionLength > 0 is your winner.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1