예제 #1
0
        private void panelText_Click(object sender, EventArgs e)
        {
            if (!_panelText.Enabled)
            {
                return;
            }

            var selection = new ThinSelection(_channelNames)
            {
                Location = PointToScreen(new Point(_panelText.Right, _panelText.Top))
            };

            if (selection.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (selection.SelectedIndex != ResetIndex)
            {
                Text = _channelNames[_selectedTextIndex = selection.SelectedIndex].Name;
                _panelText.BackColor = _channelNames[_selectedTextIndex].Color;
            }
            else
            {
                ResetAssignment();
            }
        }
예제 #2
0
        private void panelText_Click(object sender, EventArgs e)
        {
            if (!_panelText.Enabled) {
                return;
            }

            var selection = new ThinSelection(_channelNames) {Location = PointToScreen(new Point(_panelText.Right, _panelText.Top))};
            if (selection.ShowDialog() != DialogResult.OK) {
                return;
            }

            if (selection.SelectedIndex != ResetIndex) {
                Text = _channelNames[_selectedTextIndex = selection.SelectedIndex].Name;
                _panelText.BackColor = _channelNames[_selectedTextIndex].Color;
            }
            else {
                ResetAssignment();
            }
        }