Although it can be done in a dialog (controlMethodOverload is the keyword for use in a search engine), the best way is simply to create a normal form at design time instead of using a form built at run time (that’s what dialog really is).
You’ll find an example in Tutorial_RunBaseForm class and form in AOT.