I have made an InputBox class that returns a string but I want the class to return a string upon exit.
I want it to behave exactly like the Visual Basic Input Box.
For now I have passed a mutable string value into the constructor and change it that way. But then I realized the Visual Basic input box is way better.
myValue = InputBox(message, title, defaultValue)
How can I create my own InputBox class like this? I realize I can import the VB inputbox to c# but I want to make my own custom InputBox.
Edit: I guess the reason I am so fascinated by this is because Visual Basic lets you call a function without putting the name of the class. I wish there was a way of doing this in C# without using delegates. I think my solution may be to create a function which encapsulates my form. So perhaps I will rephrase my question to is there a way I can return a value through something that behaves visually like a class?
new. So I don't think you can have it be the same syntax as in VB, but that shouldn't matter - C# is not VB, it doesn't need to have the same syntax.implicit operatorto make classes look like functions but they will be very modular functions.