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 :
- Click the
project>add Windows form. - To prevent the form from resizing, set the
FormBorderStyleform control property toFixedDialog. - Set
MinimizeBoxand theMaximizeBoxproperties are false. - Set
StartPositionproperty toCenterScreenorcenterpਟਰ. - Add a button to the form with text
OKand set theDialogResetproperty toOK. Add a button to the form with - text
and set the dialogueproperty tocancel. Property property to refer to - Change
AcceptButtonto theOKbutton. - Change
CancelButtonas context toCancelbutton. - Control a
Add to Text XandRadioButtonorCheckboxform. - Press
F7to open the code view for the form. - Apply a property of type
that returns the return of the texttotextboxcontrol. - 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 :)
- 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. TheShowDialogmethod will return aDialogResult, which can be clicked to find out which button to click.
Comments
Post a Comment