SYMPTOMS
You have a control that contains:
event Validate(Cancel as Boolean)
event Change()
You get an Invalid Page Fault (IPF) when the control fires the Change event.
CAUSE
When you put a control on the Visual Basic form, Visual Basic creates an extended control that provides some extended properties. The extended control has several events reserved, such as:
event DragDrop(Source As Control, X As Single, Y As Single)
event DragOver(Source As Control, X As Single, Y As Single, State As Integer)
event GotFocus()
event LostFocus()
event Validate(Cancel As Boolean)
When a Visual Basic client tries to sink an event, the extended control's events and the control's events will be combined into the same vtable. However, if your control also defines a Validate event, Visual Basic cannot distinguish between them and considers them to be one, so that the vtable structure for the sink is incorrect.
Furthermore, if you define other events used in the extended control, you may get an error message when you try to load the control to your project. A typical error message would be: "
xxx control could not be loaded."
RESOLUTION
Change the Validate event to another name, such as:
event ValidateData(Cancel as Boolean)
You can also use the same event name with a different argument list, but then you cannot get to the event entry from the combo box in the integrated development environment (IDE).