M
Marcus Kwok
I have a form that has several pairs of TextBoxes: one editable and one
read-only. The text in the read-only TextBox should always show the
same text as the editable TextBox, except it does not have to be the
same while the user is actually typing something if that would add
unnecessary complication. The values in the TextBoxes need to be
doubles, so I plan on checking this with a Validating event.
I am thinking that I could sync the TextBoxes during the editable
TextBox's "Focus - Leave" event, but I would rather not have to code a
separate one for each pair of TextBoxes, and also it seems that the
"Leave" event occurs before Validation. The "Lost Focus" event occurs
after Validation if the keyboard is used, but if it the mouse is used,
it occurs before Validation:
http://msdn.microsoft.com/library/d...emwindowsformscontrolclassvalidatingtopic.asp
so I do not think I can use the "Lost Focus" event for this.
So, my question is: Is there a way to link the two TextBoxes using the
Designer, or if not, what is the best way to approach this? I am using
Managed Extensions to C++ (VS .NET 2003).
read-only. The text in the read-only TextBox should always show the
same text as the editable TextBox, except it does not have to be the
same while the user is actually typing something if that would add
unnecessary complication. The values in the TextBoxes need to be
doubles, so I plan on checking this with a Validating event.
I am thinking that I could sync the TextBoxes during the editable
TextBox's "Focus - Leave" event, but I would rather not have to code a
separate one for each pair of TextBoxes, and also it seems that the
"Leave" event occurs before Validation. The "Lost Focus" event occurs
after Validation if the keyboard is used, but if it the mouse is used,
it occurs before Validation:
http://msdn.microsoft.com/library/d...emwindowsformscontrolclassvalidatingtopic.asp
so I do not think I can use the "Lost Focus" event for this.
So, my question is: Is there a way to link the two TextBoxes using the
Designer, or if not, what is the best way to approach this? I am using
Managed Extensions to C++ (VS .NET 2003).