Link to home
Start Free TrialLog in
Avatar of claverd
claverd

asked on

Changing textbox

I have some code that was written for me that I want to modify. It is for me Horseshoe Scoring PPC Program.
When I start a NEW GAME, I want it to ask me for the Hanidcap of Pitcher1 and Handicap of Pitcher2.

Here is what I have:
      private void button10_Click(object sender, EventArgs e)
        {
            DialogResult dlgRes;
            dlgRes = MessageBox.Show("New game?", "Confirm New Game", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
            if (dlgRes != DialogResult.Yes)
            {
                return;
            }
           
           
            ringer = false;
            ringercount = 0;
            points = 0;
            updatepoints = true;
            ringerpointspair = false;
            //score:
            this.label16.Text = "0";
            this.label17.Text = "0";
            //ringers:
            this.label33.Text = "0";
            this.label35.Text = "0";
            //shoes:
            this.label44.Text = "0";
            //avg:
            this.label21.Text = "0.0";
            this.label22.Text = "0.0";
            this.labelringerspoints.Text = "Ringers: \nPoints: ";

            prevscore1 = "0";
            prevscore2 = "0";
            prevringers1 = "0";
            prevringers2 = "0";
            prevshoes = "0";
            prevringer_avg1 = "0.0";
            prevringer_avg2 = "0.0";

        } // end button10_click

So instead of Assuming I have 0 Points for label16.text and label17.text, I want my program to ask me what the Hanidcap is for each player.
Thanks for any help to an absolute NOVICE,
David
Avatar of Jase-Coder
Jase-Coder

use the inputBox:

System.String InputBox(System.String Prompt, System.String Title = "", System.String DefaultResponse = "", System.Int32 XPos = -1, System.Int32 YPos = -1)
    Member of Microsoft.VisualBasic.Interaction

the function returns the string the user enters into the inputbox for examepl

string blah = InputBox("Enter something");
if you cannot use InputBox()you will need to create a Dialog window yourself, which contains a textbox and the OK button, it is very simple!!
ASKER CERTIFIED SOLUTION
Avatar of pradeepsudharsan
pradeepsudharsan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of claverd

ASKER

Pradeepsudharsan,

Thanks for the help! Now I just need one more tweak. How about an OK button on the first Form? and then have it go to picther2.

Thanks,
David
Avatar of claverd

ASKER

How do you make the FORM not so big?


 I am using this on a POCKETPC and the form is so big the keyboard is not usable?

Thanks,
David