Hello I'm currently creating an application which has the need to add server IP addresses to it, as there is no InputBox function in C# I'm trying to complete this using forms, but am very new to the language so not 100% as to what I should do.
At the moment I have my main form and a form which will act as my inputbox which wants to hide on load. Then when the user clicks on the add IP Address on the main form I wish to open up the secondary form and return the IP address entered into a text box on the secondary form.
So how would I go about doing this? Or is there any better ways to achieve similar results?
An input box is a specially designed dialog box that allows the programmer to request a value from the user and use that value as necessary. An input box displays a title, a message to indicate the requested value, a text box for the user, and two buttons: OK and Cancel.
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a string containing the contents of the text box. Syntax. VB. InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])
In this example, the InputBox function has one argument, a string that is used to prompt the user. The function returns whatever the user enters. (If the user clicks on the cancel button, a string of length zero is returned).
The InputBox function prompts the users to enter values. After entering the values, if the user clicks the OK button or presses ENTER on the keyboard, the InputBox function will return the text in the text box. If the user clicks the Cancel button, the function will return an empty string ("").
You could just use the VB InputBox...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With