I am using managed VC++ code in a Win Form App. There is a text box -
txtRONumber. I have defined a KeyDown event handler (non-default) for it,
like below. InitializeComponent() is being called from Constructor of the
Form Class.
void InitializeComponent(void)
{
this->txtRONumber = (gcnew System::Windows::Forms::TextBox());
this->txtRONumber->Location = System::Drawing::Point(151, 35);
this->txtRONumber->Name = L"txtRONumber";
this->txtRONumber->Size = System::Drawing::Size(124, 22);
this->txtRONumber->TabIndex = 0;
this->txtRONumber->KeyDown += gcnew KeyEventHandler(this, &FrmRepairOrder::
txtRONumber_KeyDown);
}
private: System::Void txtRONumber_KeyDown(System::Object^ sender,
KeyEventArgs^ e);
Now, I am not sure but either when I add another control to the Form and
rebuild my app or add control, rebuild, close solution, reopen and rebuild,
sometime during any of these the event handler generator gets disappeared
from the InitializeComponent() function. I mean this line:
this->txtRONumber->KeyDown += gcnew KeyEventHandler(this, &FrmRepairOrder::
txtRONumber_KeyDown);
Any idea/suggestion?
ThanX.
Sush
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...et-vc/200808/1