开发者

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开发者_如何学Go for inputbox command.

Your help will be greatly appreciated.

Thank you,


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.


I would not advise you to use the InputBox routine to help with VB6 legacy code. You should simply write your own dialog to do the work. This question has been asked many times here in the context of C# and that always seems to be the answer!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜