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
FormBorderStyle
form control property toFixedDialog
. - Set
MinimizeBox
and theMaximizeBox
properties are false. - Set
StartPosition
property toCenterScreen
orcenterpਟਰ
. - Add a button to the form with text
OK
and set theDialogReset
property toOK
. Add a button to the form with - text
and set the dialogue
property tocancel
. Property property to refer to - Change
AcceptButton
to theOK
button. - Change
CancelButton
as context toCancel
button. - Control a
Add to Text X
andRadioButton
orCheckbox
form. - Press
F7
to open the code view for the form. - Apply a property of type
that returns the return of the text
totextbox
control. - 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. TheShowDialog
method will return aDialogResult
, which can be clicked to find out which button to click.
Comments
Post a Comment