ErrorProvider Xojo Plugin |
|
ErrorProvider.RequestBuddyControl Event
Use this event to solve cases when you have complex embedding and the ErrorProvider fails to embed canvas to display the Error symbol.

RequestBuddyControl(
newSource
as DesktopUIControl,
source
as RectControl)
as Canvas
Parameters
- newSource
- The source control that indicates which error the event applies to. (This can be nil if the source is old style control, in which case the source parameter would contain reference to the control). Note when running on Xojo older than 2021r3 then this parameter will not exist.
- source
- The source control that indicates which error the event applies to. (This can be nil if the source is new style control, in which case the newSource parameter would contain reference to the control)
Returns
- Canvas
Remarks
It can fail to embed its own canvas on the fly in complex embedding situation, especially if group boxes that contain canvas are anywhere on the window. Then its good to resort to use this event.
When using this event you place your own canvas at back of your edit field or control that you want to Error validate. Top and Left location don't need to be accurate but it is important that you place it in same nesting hierarchy as the control to be validated.
Rules of buddy control canvases that you assign to the ErrorProvider:
1. No event on them may be wired up (if they are then your application will get exception)
2. It must be one buddy control per control to validate. So if you got 2 Text boxes then you places 2 canvases, both text-boxes cannot share the same.
Function RequestBuddyControl(newSource as DesktopUIControl, source as RectControl) As Canvas
if source = TextField2 then
return Canvas2
elseif source = TextField3 then
return Canvas3
end if
return nil
End Function
See Also
ErrorProvider Control