Search code examples
inputuser-inputinputboxdelphi-prism

InputBox is not accessible on Delphi Prism after adding Microsoft.VisualBasic reference


I need to display an Input message box to gather information from the user. I am using Delphi Prism.

I did try someone else's suggestion by adding Microsoft.VisualBasic reference to my program to get access to InputBox, but it didn't work. Complier keeps saying 'unknown identifier."

Is there an InputBox command for Delphi Prism? If so, how do you get at it. If not, is there something similar for Delphi Prism.

I know, I can simply create a simple window form with Editbox and buttons, but that I think is tedious and redundant work when the Delphi Prism probably has something bultin and easier to use for inputbox command.

Your help will be greatly appreciated.

Thank you,


Solution

  • The InputBox from VisualBasic is in the Namespace Microsoft.VisualBasic.Interaction. So you either need this in the uses clause (you still need the reference to the VB assembly) or you need to use the full qualified name Microsoft.VisualBasic.Interaction.InputBox() in your code.