public ComboBox AddNewComboBox(CastListBoxArray associatedListBoxes)
        {
            connectedListBoxes = associatedListBoxes;

            ComboBox newComboBox = new
                ComboBox();

            //add to the collection list
            this.List.Add(newComboBox);

            //add to the overall form controls
            Hatchu.Controls.Add(newComboBox);

            newComboBox.Top = 45 + levelCount * 170;
            newComboBox.Width = 95;
            newComboBox.Left = miniCount * (newComboBox.Width + 10) + 80;
            newComboBox.Tag = this.Count;
            newComboBox.Text = "";
            newComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            newComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

            newComboBox.SelectedIndexChanged += new System.EventHandler(ClickHandler);
            newComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(EnterHandler);

            miniCount++;

            if (Count % 6 == 0)
            {
                miniCount = 0;
                levelCount++;
            }

            return newComboBox;
        }
Beispiel #2
0
        public Hatchu()
        {
            InitializeComponent();

            listBoxArray = new CastListBoxArray(this);
            comboBoxArray = new CastSelectionBoxArray(this, listBoxArray);
            danceTypeBoxArray = new DanceTypeBoxArray(this);
            textBoxArray = new PieceNameBoxArray(this);
            showOrder = new ShowOrder(this);
            showOrderPosition = new ShowOrderPosition(this);
            castListArray = new List<CastList>();
            solutionList = new List<ShowOrder>();

            listBoxArray[0].Parent = panelContainer;
            comboBoxArray[0].Parent = panelContainer;
            danceTypeBoxArray[0].Parent = panelContainer;
            textBoxArray[0].Parent = panelContainer;

            listBoxArray[0].Visible = false;
            comboBoxArray[0].Visible = false;
            danceTypeBoxArray[0].Visible = false;
            textBoxArray[0].Visible = false;

            pieceNameLbl.Parent = panelContainer;
            danceTypeLbl.Parent = panelContainer;
            castListLbl.Parent = panelContainer;
            castMembersLbl.Parent = panelContainer;

            solutionsContainer.Parent = this;
            solutionsContainer.Location = panelContainer.Location;
            loadingBox.Parent = this;
            loadingBox.Location = new Point(this.Width / 2, this.Height / 2);

            foreach (string item in danceTypeBoxArray[0].Items)
                DanceTypeBoxArray.amountOfTypes.Add(item, 0);

            SwitchVisibility("startup");

            if (!File.Exists("sessions.txt"))
            {
                loadSession.Enabled = false;
            }
        }
 public CastSelectionBoxArray(Form host, CastListBoxArray associatedListBox)
 {
     Hatchu = host;
        this.AddNewComboBox(associatedListBox);
 }