Ejemplo n.º 1
0
        private void btnRnd_Click(object sender, EventArgs e)
        {
            var val     = rnd.Next(1, 999);
            var counter = 0;

            if (_tree != null)
            {
                _tree.Find(val);
                while (_tree.Find(val) && counter++ < 999)
                {
                    val = rnd.Next(1, 999);
                }
            }
            inputTextBox.Text = val.ToString();
            btnAdd_Click(btnAdd, new EventArgs());
        }