C# - Menu Strip Duplicating for no Apparent Reason

I'm creating a Windows form based multi tap (old phone keypad) type system, using timers and arrays. However, whenever I click a button to append text to a text box, the menu strips duplicates vertically, I have no idea why seem as I have note referenced the menu string in my CS. The code itself isn't finished, I'd just like to stop this duplication from happening, and for the character from the array to actually append to the Rich Text Box. Any help at all would be appreciated, thanks!

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

    namespace Mini_Keyboard
        public partial class MiniKeyboard : Form
            public MiniKeyboard()

            string currentMode = "Multi Tap"; // Sets the mode of the app on startup to be "Multi Tap"
            int intIntervalRequired = 1000; // Time interval in which the user has to switch through the characters
            string currentKey;
            string prevKey;
            int currentIndex = -1;
            string[] keyPad1 = new string[7] { ".", "~", "\"", "1", "'", ":", ";" }; // Characters for key 1
            string[] keyPad2 = new string[7] { "a", "b", "c", "2", "A", "B", "C" }; // Characters for key 2
            string[] keyPad3 = new string[7] { "d", "e", "f", "3", "D", "E", "F" }; // Characters for key 3
            string[] keyPad4 = new string[7] { "g", "h", "i", "4", "G", "H", "I;" }; // Characters for key 4
            string[] keyPad5 = new string[7] { "j", "k", "l", "5", "J", "K", "L" }; // Characters for key 5
            string[] keyPad6 = new string[7] { "m", "n", "o", "6", "M", "N", "O" }; // Characters for key 6
            string[] keyPad7 = new string[9] { "p", "q", "r", "s", "7", "P", "Q", "R", "S" }; // Characters for key 7
            string[] keyPad8 = new string[7] { "t", "u", "v", "8", "T", "U", "V" }; // Characters for key 8
            string[] keyPad9 = new string[9] { "w", "x", "y", "z", "9", "W", "X", "Y", "Z" }; // Characters for key 9
            string[] keyPad0 = new string[2] { "0", " " }; // Characters for key 0
            string[] keyPadStar = new string[3] { "*", "-", "_" }; // Characters for key Star
            string[] keyPadHash = new string[3] { "#", "-", "_" }; // Characters for key Hash
            Timer timer = new Timer();
            public void runTimer()

                timer.Tick += new EventHandler(stopTimer);
                timer.Interval = intIntervalRequired;
                timer.Enabled = true;

            public void stopTimer(object sender, EventArgs e)
                prevKey = currentKey;
                currentKey = "";
                currentIndex = -1;

            private void btnChangeMode_Click(object sender, EventArgs e)
                if (currentMode == "Multi Tap") // If the current mode is "Multi Tap", change it to "Prediction"
                    currentMode = "Prediction";
                    txtCurrentMode.Text = currentMode;
                else // If the current mode is "Prediction", change it to "Multi Tap"
                    currentMode = "Multi Tap";
                    txtCurrentMode.Text = currentMode;

            private void btnKeyPadNo2_Click(object sender, EventArgs e)
                currentKey = "2";
                appendChar(ref keyPad2);

            public void appendChar(ref string[] key)
                if (currentIndex == -1)

This is a recode of a form I made before which had the same bug, I decided to start from scratch to fix it, but it didn't.

Here's a link to a screencap of the problem:

UPDATE: Turns out the Mode button is no longer working, and it was fine before this happened.


Remove the InitializeComponent(); in runTimer. It should be called once in constructor.

Your current flow is:

appendChar -> runTimer -> InitializeComponent

Need Your Help

I want use jQuery to get my Column Heading in a Datagrid

jquery asp.net gridview web

want to get the header text of the the column I click on.

Java, Socket and transfer text

java sockets

I have one problem, I learn how work with socket and I write programm with next code :

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.