If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: How to add "OnFocus" event in Visual Studio 2005

hoe do you know whether it is working or not ? just put a break point that function and see if the control comes there... and assign the text in that control to some string and see if the text present in that control gets updated to that string...

Re: How to add "OnFocus" event in Visual Studio 2005

Originally Posted by vcdebugger

hoe do you know whether it is working or not ? just put a break point that function and see if the control comes there... and assign the text in that control to some string and see if the text present in that control gets updated to that string...

Code:

string text = txtIpB.Text;

Thank you for your reply.

I put a break point inside txtIpB_OnFocus() to see that this method is indeed called when I focus on the control. And saw that the "txtIpB.Text" contains the string control has as it was expected.

Re: How to add "OnFocus" event in Visual Studio 2005

by default when the focus comes to that control automatically all the text inside that should get selected with what I have observed some years back in vc6.. not sure of C#..

anyways there should be some property for edit box which makes it EDITABLE so that all the text get selected and user can start typing so that old text gets erased automatically... right click on text box and check the properties referring to option - *EDITABLE ** NON-EDITABLE