I had a look at your code, it works, but I have following comments:
- You should not stop the main thread with:
Do While Not(ready)
DoEvents
Loop
- You should not use the same name, InputBox in this case, for a View added in the Designer and another in the code.
You have a warning about this in the Logs Tab. The same with btn.
- I wouldn't create the Dialog in the code each time when the function is called and remove evrything when you leave it.
I would add a layout in the Designer and use the Visible property.
Your code works like a modal dialog but blocks the main thread as long as the dialog is displayed, which is not recomended.
Attached you find a modified version of your code with my vision.
It's not 'modal' and doesn't block the main thread.
And finaly, I would make a CustomView.