Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to put data into a edit box 1

Status
Not open for further replies.

psnead

Programmer
Jul 5, 2000
41
DK
I am trying to put data into a edit box.&nbsp;&nbsp;How do I activate the box so that I can work with it?&nbsp;&nbsp;<br><br>What happens is the user inputs a filename in one edit box, and then presses tab to get to the next edit box.&nbsp;&nbsp;I want to take the filename from the first edit box, cat a file extension on it, and then write the new name in the second edit box.&nbsp;&nbsp;<br><br>I have a default value in the edit box, so when the user tabs to that box, it is highlighted, but I want to actually delete the default, and replace it with the value from the first edit box with a new file extension.<br><br>Any suggestions?
 
psnead,<br><br>Say you use the Class Wizard to create two variables of type 'Control' one each for the edit boxes named '_oEdit1' and '_oEdit2'.<br><br>Now use the Class Wizard to create a handler function for the second edit boxes WM_SETFOCUS message, then in that handler you could do this.<br><br>CString sStr;<br>_oEdit1.GetWindowText( sStr);<br>// perform string manipulation to add file extension<br><br>_oEdit2.SetWindowText( sStr);<br><br>Of course you might want the handler to be for the first edit box's WM_LOSTFOCUS message.<br><br>Good luck<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top