Help me with my first C# Pokemon Editor pls!

Discussion in 'Computer Programming, Emulation, and Game Modding' started by V0LT!GE, Feb 19, 2016.

  1. V0LT!GE
    OP

    V0LT!GE Advanced Member

    Newcomer
    99
    25
    Feb 13, 2016
    Gambia, The
    Good Day "Profs" :P

    Today Im here to learn more about programming with C# (I Know I Know but Listen pls :D)
    So... Ive a Problem with my first Programm in Visual Studio 2015 where Im actually programming with C#.
    In my Source Code there is a BUG/Problem with the Setting of numbers
    first of all itsa Program for Pokemon where u can create a Pokemon Text which u can use in PkHex like Pokemon Showdown Teambuilder with the only Thing that you can set the Pokemon, Item
    Ability, Nature, Attacks and EVs(< EVs are my Problem...)

    Here is my Source Code :D
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace LittleTB
    {
        public partial class FmLittleTB : Form
        {
    
            string sPokemon;
            string sItem;
            string sAbility;
            string sNature;
            string sAttack1;
            string sAttack2;
            string sAttack3;
            string sAttack4;
            string sEV1;
            string sEV2;
            string sEV3;
            string sEV4;
            string sEV5;
            string sEV6;
    
            public FmLittleTB()
            {
                InitializeComponent();
            }
    
            private void FmLittleTB_Load(object sender, EventArgs e)
            {
    
            }
    
            private void gBseSpecies_Enter(object sender, EventArgs e)
            {
    
            }
                    
            private void lbPokemon_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbItem_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbAbility_Click(object sender, EventArgs e)
            {
    
            }
    
            private void tBAttack1_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBAttack2_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBAttack3_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBAttack4_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBPokemon_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBItem_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBAbility_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void gbseNature_Enter(object sender, EventArgs e)
            {
    
            }
    
            private void lbNature_Click(object sender, EventArgs e)
            {
    
            }
    
            private void gBseAttacks_Enter(object sender, EventArgs e)
            {
    
            }
        
            private void lbAttack1_Click(object sender, EventArgs e)
            {
    
            }
    
            private void gBIVsnEVs_Enter(object sender, EventArgs e)
            {
    
            }
    
            private void lbHP_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbAtk_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbDef_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbSpA_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbSpD_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbSpe_Click(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV1_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV2_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV3_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV4_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV5_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV6_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBTotalEVs_TextChanged(object sender, EventArgs e)
            {
    
            }
                 
            private void lbEVs_Click(object sender, EventArgs e)
            {
    
            }
    
            private void lbTotalEVs_Click(object sender, EventArgs e)
            {
    
            }
    
            private void btCreate_Click(object sender, EventArgs e)
            {
                sPokemon = this.tBPokemon.Text;
                sItem = this.tBItem.Text;
                sEV1 = this.tBEV1.Text;
                sEV2 = this.tBEV1.Text;
                sEV3 = this.tBEV1.Text;
                sEV4 = this.tBEV1.Text;
                sEV5 = this.tBEV1.Text;
                sEV6 = this.tBEV1.Text;
                sAbility = this.tBAbility.Text;
                sNature = this.tBNature.Text;
                sAttack1 = this.tBAttack1.Text;
                sAttack2 = this.tBAttack2.Text;
                sAttack3 = this.tBAttack3.Text;
                sAttack4 = this.tBAttack4.Text;
    
        
                 //Here is the part of the Code with my Problem:
                this.tBPokemonText.Text = sPokemon + " " + "@" + " ";
                this.tBPokemonText.Text += sItem + "\r\n";
                this.tBPokemonText.Text += "Ability" + ":" + " " + sAbility + "\r\n";
                this.tBPokemonText.Text += "EVs" + ":" + " ";
                this.tBPokemonText.Text += sEV1 + " " + "HP " + "/" + " ";  /*From Here to
              this.tBPokemonText.Text += sEV2 + " " + "Atk" + "/" + " ";  /
      >          this.tBPokemonText.Text += sEV3 + " " + "Def" + "/" + " ";  /
                this.tBPokemonText.Text += sEV4 + " " + "SpA" + "/" + " "; /
                this.tBPokemonText.Text += sEV5 + " " + "SpD" + "/" + " "; /
                this.tBPokemonText.Text += sEV6 + " " + "Spe" + "/" + " "+  "\r\n"; /
                this.tBPokemonText.Text += sNature + " " + "Nature" + "\r\n";         /
                this.tBPokemonText.Text += "-" + sAttack1 + "\r\n";                        /
                this.tBPokemonText.Text += "-" + sAttack2 + "\r\n";                        /
                this.tBPokemonText.Text += "-" + sAttack3 + "\r\n";                        /
                this.tBPokemonText.Text += "-" + sAttack4 + "\r\n";                        /*Here the pro
    
    
    
    
            }
    
            private void btExit_Click(object sender, EventArgs e)
            {
                Close();
            }
    
            private void tBNature_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV1_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV2_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV3_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV4_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV5_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
            private void tBEV6_TextChanged_1(object sender, EventArgs e)
            {
    
            }
    
        
        }
    }
    
    so u can see maaaany Things and when u see something like lb or tB, thats are only shortnames for me to have a better view about my Code :D

    Now the Problem:
    i cant explain it good enough for u guys so pls download my file :P
    After u Downloaded the file type something in the EV boxes and they will appear in every space in the text which u can see at the left side asTextBox

    Screenshot:
    [​IMG]

    See? I only tiped in the EV Boxes HP SpA and Spe number but there in the TextBox u can see for every each EV the number 252 and not the number onyl for HP SpA and Spe and also u cant see the 4 which i tiped in the SpA EV Box...

    Could u give me a tip or can u help me out pls?:cry:
    AND ITS !NOT! A VIRUS EDGE BROWSER IS A BIT CHEEKY :P
     

    Attached Files:

    Last edited by V0LT!GE, Feb 19, 2016
  2. Growlith1223

    Growlith1223 GBAtemp Regular

    Member
    297
    245
    Oct 15, 2015
    United States
    IMO, you can use a StringBuilder to make this easier on your life.

    Code:
    StringBuilder sb;
    sb.Append("insert text here"); // This will create text that is added onto the string, can't remember if it does a new line or not but that's just a simple "\n" in the text!
    
    textControl.text = sb.ToString();
    
    Regardless, it looks like the code is trying to overwrite the values, have you tried putting values in every control? it might be just getting the very first one and only that one
     
  3. V0LT!GE
    OP

    V0LT!GE Advanced Member

    Newcomer
    99
    25
    Feb 13, 2016
    Gambia, The
    Ah thanks ;)
     
  4. djkav

    djkav Advanced Member

    Newcomer
    50
    5
    Apr 8, 2009