You can make event handlers for native controls. Just make sure to do everything the Wizard does.
edit
Here’s the steps.
- Declare an object of the type of the native control. Put this right below
// Add Custom Module Level Variables Here **
public EpiTextBox txtPONum; //e5d73cb9-1d94-45ce-85be-db4c85fe3264
- Create initialze call in
public void InitializeCustomCode()
. Reference the native controls GUID.
txtPONum = (EpiTextBox)csm.GetNativeControlReference("e5d73cb9-1d94-45ce-85be-db4c85fe3264");
this.txtPONum.Click += new System.EventHandler(this.txtPONum_Click);
- Create destroy call in
public void DestroyCustomCode()
.
// Begin Custom Code Disposal
this.txtPONum.Click -= new System.EventHandler(this.txtPONum_Click);
// End Custom Code Disposal
- Create the handler function
private void txtPONum_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
}
This might be easier to do if you add a custom control of the same type, use the event wizard to make the code for it, then go back and change the references in the wizard created code to be for the native control. You’ll need to manually add the line for GetNativeControlReference