input - Creating an inputbox with radiobuttons c# -


I am currently making a simple C # game for a college job, wondering if a radio or checkbox is similar ) Input on shipment, in an external window I am currently using this to get the user name:

  public form 1 () {InitializeComponent (); Start (); GlobalVar.Username = Microsoft.VisualBasic.Interaction.InputBox ("Welcome to EasiGame, please enter your username.", "Welcome", "Player 1", -1, -1); Label4.Text = GlobalVar.Username; }  

This reference is VB, and it works well, though I can include a radio button or a different box in this box, so that user input for a difficulty setting Could be caught. thank you in advanced!

You can apply your own form Suppose you use the latest version of Visual Studio :

  1. Click the project > add Windows form .
  2. To prevent the form from resizing, set the FormBorderStyle form control property to FixedDialog .
  3. Set MinimizeBox and the MaximizeBox properties are false.
  4. Set StartPosition property to CenterScreen or centerpਟਰ .
  5. Add a button to the form with text OK and set the DialogReset property to OK . Add a button to the form with
  6. text and set the dialogue property to cancel . Property property to refer to
  7. Change AcceptButton to the OK button.
  8. Change CancelButton as context to Cancel button.
  9. Control a Add to Text X and RadioButton or Checkbox form.
  10. Press F7 to open the code view for the form.
  11. Apply a property of type that returns the return of the text to textbox control.
  12. You will also need to take a form of difficulty to get form from the form; I'll let you remove this part for yourself :)
  13. To show the form, create an example and call the ShowDialog () method. This will stop the calling method until the user has clicked a button. The ShowDialog method will return a DialogResult , which can be clicked to find out which button to click.

Comments