That should work. Try the following and let me know if this changes anything:
Dim regTask As Task = NothingDim editorForm AsNew TaskEditDialog(ts, Nothing, True, True) With {.Title = "Create New Task"} If editorForm.ShowDialog() = Windows.Forms.DialogResult.OK Then regTask = editorForm.Task EndIf