コード例 #1
0
        private void grpComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.grpNmIDTextBox.Text = "-1";
            this.grpNmTextBox.Text   = "";

            if (this.grpComboBox.Text == "Everyone" ||
                this.grpComboBox.Text == "Single Person")
            {
                this.grpNmTextBox.BackColor = Color.WhiteSmoke;
                this.grpNmTextBox.Enabled   = false;
                this.grpNmButton.Enabled    = false;
            }
            else
            {
                this.grpNmTextBox.BackColor = Color.FromArgb(255, 255, 118);
                this.grpNmTextBox.Enabled   = true;
                this.grpNmButton.Enabled    = true;
            }
            if (this.prsnID > 0 && this.grpComboBox.Text == "Single Person")
            {
                this.grpComboBox.SelectedItem = "Single Person";
                this.grpNmIDTextBox.Text      = this.prsnID.ToString();
                this.grpNmTextBox.Text        = cmnCde.getPrsnName(this.prsnID) + " (" + cmnCde.getPrsnLocID(this.prsnID) + ")";
            }
        }
コード例 #2
0
        private void grpComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.grpNmIDTextBox.Text = "-1";
            this.grpNmTextBox.Text   = "";
            string slctdText = (e.AddedItems[0] as ComboBoxItem).Content as string;

            //cmnCde.showSQLNoPermsn(slctdText);
            if (slctdText == "Everyone" ||
                slctdText == "Single Person")
            {
                this.grpNmTextBox.IsReadOnly  = true;
                this.grpNmButton.IsEnabled    = false;
                this.grpNmIDTextBox.IsEnabled = false;
                this.grpNmTextBox.Background  = new SolidColorBrush(
                    System.Windows.Media.Color.FromArgb(255, 240, 240, 240));
            }
            else
            {
                this.grpNmTextBox.Background  = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 118));
                this.grpNmTextBox.IsReadOnly  = false;
                this.grpNmButton.IsEnabled    = true;
                this.grpNmIDTextBox.IsEnabled = true;
            }
            if (this.prsnID > 0 && slctdText == "Single Person")
            {
                this.grpComboBox.SelectedItem = "Single Person";
                this.grpNmIDTextBox.Text      = this.prsnID.ToString();
                this.grpNmTextBox.Text        = cmnCde.getPrsnName(this.prsnID) + " (" + cmnCde.getPrsnLocID(this.prsnID) + ")";
            }
        }