예제 #1
0
파일: frmVitalGroup.cs 프로젝트: ewin66/HIS
        private void lstGroupItem_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (!m_blnCanGroupItemCheckChanged)
            {
                return;
            }

            //判断参数是否在已经选择的组里面
            if (chklstGroup.CheckedIndices.Count > 0 && chklstGroup.CheckedIndices[0] == chklstGroup.SelectedIndex)
            {
                if (e.NewValue == CheckState.Checked)
                {
                    m_arlCheckParam.Add(lstGroupItem.Items[e.Index]);
                }
                else if (e.NewValue == CheckState.Unchecked)
                {
                    m_arlCheckParam.Remove(lstGroupItem.Items[e.Index]);
                }
            }
            else
            {
                m_blnCanGroupItemCheckChanged = false;
                e.NewValue = CheckState.Unchecked;
                m_blnCanGroupItemCheckChanged = true;
            }
        }
예제 #2
0
 private void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     Engine.SettingsProvider.Set(
         checkedListBox.Items[e.Index],
         (e.NewValue == CheckState.Unchecked ? false : true),
         PersistHint.AcrossSessions);
 }
예제 #3
0
 private void AssessmentCheckBox_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (!updating)
     {
         String value = this.Items[e.Index].Text;
         foreach (String key in additionalText.Keys)
         {
             if (value.Contains(key))
             {
                 value = key;
                 break;
             }
         }
         if (e.CurrentValue == CheckState.Unchecked && e.NewValue == CheckState.Checked)
         {
             if (!selectedItems.Contains(value))
             {
                 selectedItems.Add(value);
             }
         }
         else if (e.CurrentValue == CheckState.Checked && e.NewValue == CheckState.Unchecked)
         {
             if (selectedItems.Contains(value))
             {
                 selectedItems.Remove(value);
             }
         }
     }
 }
예제 #4
0
 private void listView2_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (this.listView2.Items[e.Index].ForeColor == Color.Gray)
     {
         e.NewValue = CheckState.Unchecked;
     }
 }
예제 #5
0
        // 得到所有checked Item
        // 是当前的所有checked item加上考虑e参数中可能增加和减除的item,合并而成
        // e可以为null,表示不关心这个特殊情况
        List <ListViewItem> GetCheckedItems(System.Windows.Forms.ListView listview,
                                            System.Windows.Forms.ItemCheckEventArgs e)
        {
            List <ListViewItem> selectedItems = new List <ListViewItem>();

            foreach (ListViewItem item in listview.CheckedItems)
            {
                selectedItems.Add(item);
            }
            // selectedItems.AddRange(listview.CheckedItems);

            if (e != null)
            {
                if (e.NewValue == CheckState.Checked)
                {
                    selectedItems.Add(listview.Items[e.Index]);
                }
                else
                {
                    selectedItems.Remove(listview.Items[e.Index]);
                }
            }

            return(selectedItems);
        }
예제 #6
0
		private void checkedFrames_ItemCheck(object sender, ItemCheckEventArgs e) {
			if (e.NewValue != CheckState.Checked) {
				btnExtract.Enabled = (checkedFrames.CheckedItems.Count > 0 && textBox1.Text.Length > 0);
				return;
			}
			btnExtract.Enabled = (textBox1.Text.Length > 0);
		}
예제 #7
0
        private void m_clbUtilities_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            int cnt = m_clbUtilities.CheckedItems.Count;

            cnt = (e.NewValue == CheckState.Checked) ? cnt + 1 : cnt - 1;
            m_btnRunUtils.Enabled = cnt > 0;
        }
예제 #8
0
 private void chkListPassenger_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     PassengerDTOs p = ((PassengerDTOs)this.chkListPassenger.Items[e.Index]);
     if (e.NewValue == CheckState.Checked)
     {
         if (myList.Count == 5)
         {
             e.NewValue = CheckState.Unchecked;
             MessageBox.Show("对不起,你最多只能选择5位联系人!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             if (!myList.Contains(p))
             {
                 myList.Add(p);
             }
         }
     }
     else
     {
         myList.Remove(p);
     }
     mf.myList = myList;
     mf.LoadPassenger();
 }
예제 #9
0
파일: PDCPVS.cs 프로젝트: dev4s/2009-pdcpvs
        private void resultBox_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (e.NewValue == CheckState.Checked)_checkedItemsOnResultBox.Add(e.Index);
            else _checkedItemsOnResultBox.Remove(e.Index);

            buttonDeleteSelected.Enabled = _checkedItemsOnResultBox.Count != 0;
        }
예제 #10
0
 private void _categories_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     #region Ensure that the at least one category is selected
     if (e.NewValue == CheckState.Checked)
     {
         btnSave.Enabled = true;
     }
     else
     {
         bool enable = false;
         for (int i = 0; i < _categories.Items.Count; i++)
         {
             if (_categories.GetItemChecked(i))
             {
                 btnSave.Enabled = true;
                 enable          = true;
             }
         }
         if (!enable)
         {
             btnSave.Enabled = false;
         }
     }
     #endregion
 }
예제 #11
0
        /// <summary>
        /// Handle not changing checked state of item when double clicking to edit it.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>

        private void lstFiles_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (inhibitFileEncodingAutoCheck)
            {
                e.NewValue = e.CurrentValue;
            }
        }
예제 #12
0
        private void clbCameras_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            try
            {
                if (e.NewValue == CheckState.Checked)
                {
                    ActivateVideoCapability((FilterInfo)clbCameras.Items[e.Index]);

                    // Only save the camera after we were able to successfully activate it
                    AVReg.WriteValue(AVReg.SelectedCameras, vcg.Source.Moniker,
                                     vcg.Source.FriendlyName);
                }
                else if (e.NewValue == CheckState.Unchecked)
                {
                    // Remove the camera from the registry, even if we can't shut it down
                    AVReg.DeleteValue(AVReg.SelectedCameras, vcg.Source.Moniker);

                    DeactivateVideoCapability((FilterInfo)clbCameras.SelectedItem);
                }
            }
            catch (COMException ex)
            {
                Log(DShowError._AMGetErrorText(ex.ErrorCode));
                Log(ex.ToString());
            }
            catch (Exception ex)
            {
                Log(ex.ToString());
            }
        }
예제 #13
0
        private void vwGrd1_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            int _cobranza = 0;

            _cobranza = Convert.ToInt32(vwGrd1.Items[e.Index].SubItems[0].Text);
            _datosCierre.MarcaCobranza(_cobranza, (e.NewValue.ToString().Trim().ToUpper() == "CHECKED"));
        }
예제 #14
0
        private void checkClientForAll(System.Windows.Forms.ItemCheckEventArgs e)
        {
            int  i;
            bool matchFound;

            matchFound = true;

            i = 1;
            while (i < clientAssignmentCheckedListBox.Items.Count)
            {
                //MessageBox.Show(clientAssignmentCheckedListBox.GetItemCheckState(i).ToString());
                if (i != e.Index)
                {
                    if (clientAssignmentCheckedListBox.GetItemChecked(i) == false)
                    {
                        matchFound = false;
                        break;
                    }
                }

                i++;
            }

            if (matchFound == true)
            {
                clientAssignmentCheckedListBox.SetItemChecked(0, true);
            }
        }
예제 #15
0
 private void expectedWordsListBox_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (!this.allowExpectedWordsCheck)
     {
         e.NewValue = e.NewValue == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked;
     }
 }
예제 #16
0
        private void chlPList_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (chlPList.SelectedIndex == -1)
            {
                return;
            }

            /*if(e.CurrentValue == CheckState.Checked)
             * {
             *      e.NewValue = CheckState.Checked;
             *      MessageBox.Show("At this time, botNET cannot be unloaded");
             *      return;
             * }*/

            Process p = ((PListItem)chlPList.Items[e.Index]).Proc;

            this.chlPList.Enabled = false;
            if (Loader.Go(p.Handle, Convert.ToUInt32(p.MainModule.BaseAddress.ToInt32()), p.MainWindowHandle))
            {
                //e.NewValue = CheckState.Checked;
                this.D2Refresh();
            }
            else
            {
                MessageBox.Show("Load Failed");
                //e.NewValue = CheckState.Unchecked;
                this.D2Refresh();
            }
            this.chlPList.Enabled = true;
        }
예제 #17
0
        private void lvApplies_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            enterListView = true;

            if (!this.IsActivateChecked)
            {
                return;
            }

            ListViewItem item = lvApplies.Items[e.Index];

            item.Selected = true;
            if (e.NewValue == CheckState.Checked)
            {
                this.groupBox1.Enabled = true;
                ShowSubText(item);
            }
            else
            {
                cbAim.Text             = "";
                cbPart.Text            = "";
                txtChargeDetail.Text   = "";
                this.groupBox1.Enabled = false;
            }
        }
예제 #18
0
 void trapsCheckedListBox_ItemCheck( object sender, ItemCheckEventArgs e )
 {
     if ( !ignoreChanges )
     {
         switch ( e.Index )
         {
             case 0:
                 moveFindItem.Unknown1 = e.NewValue == CheckState.Checked;
                 break;
             case 1:
                 moveFindItem.Unknown2 = e.NewValue == CheckState.Checked;
                 break;
             case 2:
                 moveFindItem.Unknown3 = e.NewValue == CheckState.Checked;
                 break;
             case 3:
                 moveFindItem.Unknown4 = e.NewValue == CheckState.Checked;
                 break;
             case 4:
                 moveFindItem.SteelNeedle = e.NewValue == CheckState.Checked;
                 break;
             case 5:
                 moveFindItem.SleepingGas = e.NewValue == CheckState.Checked;
                 break;
             case 6:
                 moveFindItem.Deathtrap = e.NewValue == CheckState.Checked;
                 break;
             case 7:
                 moveFindItem.Degenerator = e.NewValue == CheckState.Checked;
                 break;
         }
         OnDataChanged( this, EventArgs.Empty );
     }
 }
예제 #19
0
        private void checkedListBoxUnitOps_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            // individual update
            bool isChecked = false;

            if (e.NewValue.Equals(CheckState.Checked))
            {
                isChecked = true;
            }
            int    idx = e.Index;
            string s   = (string)this.checkedListBoxUnitOps.Items[idx];

            this.flowsheet.UnitOpManager.GetUnitOpControl(s).IsShownInEditor = isChecked;

            if (this.updateFlag)
            {
                if (this.flowsheet != null)
                {
                    if (this.flowsheet.Editor != null)
                    {
                        this.flowsheet.Editor.UpdateUnitOpsUI();
                    }
                }
            }
        }
예제 #20
0
 private void boxFilters_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (ignoreCheck)
         e.NewValue = e.CurrentValue;
     else
         Settings.filters[e.Index].Enabled = e.NewValue == CheckState.Checked;
 }
예제 #21
0
		private void checkedListBoxSeries_ItemCheck(object sender, ItemCheckEventArgs e) {			
            int index = e.Index;
            DBSeries item = (DBSeries)checkedListBoxSeries.Items[index];

            // Add/Remove items from list
            if (item != null) {                
                // Item state before item was clicked 
                if (checkedListBoxSeries.GetItemChecked(index)) {

                    // Store items changes
                    if (!UnCheckedItems.Contains(item)) {
                        UnCheckedItems.Add(item);
                    }
                    if (CheckedItems.Contains(item)) {
                        CheckedItems.Remove(item);
                    }
                                        
                    CheckedCount -= 1;
                    labelSeriesSelected.Text = (CheckedCount).ToString() + " Series Selected";
                }
                else {
                    // Store items changes
                    if (!CheckedItems.Contains(item)) {
                        CheckedItems.Add(item);
                    }
                    if (UnCheckedItems.Contains(item)) {
                        UnCheckedItems.Remove(item);
                    }
                    
                    CheckedCount += 1;
                    labelSeriesSelected.Text = (CheckedCount).ToString() + " Series Selected";
                }
            }

		}
예제 #22
0
        private void ComboForanes_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (e.Index == -1)
            {
                return;
            }

            if (e.NewValue == System.Windows.Forms.CheckState.Checked)
            {
                Objetos.CLLaveForanea fk;
                fk = this.Foraneas[e.Index];
                FormAccion dlg = new FormAccion(Modo);
                dlg.Eliminar    = fk.Eliminar;
                dlg.Comentarios = fk.Comentarios;
                System.Collections.Generic.List <Objetos.CCampoFK> lista = DB.DameCamposFK(fk.id);
                Objetos.CCampoFK cfk = lista[0];
                if (this.Modo == 1)
                {
                    dlg.Tabla = cfk.hija;
                }
                else
                {
                    dlg.Tabla = cfk.maestra;
                }
                dlg.Mensaje = fk.Mensage;
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                {
                    e.NewValue = System.Windows.Forms.CheckState.Unchecked;
                    return;
                }
                fk.Eliminar    = dlg.Eliminar;
                fk.Mensage     = dlg.Mensaje;
                fk.Comentarios = dlg.Comentarios;
            }
        }
예제 #23
0
        private void AssemblySelected(object sender, ItemCheckEventArgs e)
        {
            // When an assembly gets changed, find all classes that belong to it
            Type[] Classes;
#if USENAMESPACES
            Classes = mAssemblies
                .Select(name => Assembly.Load(name))
                .SelectMany(assem => assem.GetTypes())
                .Where(type => type.Namespace == mNamespaces[e.Index])
                .ToArray();
#else
            Classes = Assembly.Load(mAssemblies[e.Index].FullName).GetTypes().ToArray();
#endif

            // If it got unchecked, then remove its classes from the Classes list
            if (e.NewValue != CheckState.Checked)
                foreach (Type t in Classes)
                    mAvailableClasses.Remove(t);
            // Else, put them on the Classes list
            else
                foreach (Type t in Classes)
                    mAvailableClasses.Add(t);

            // Display a sorted list of all available classes
            mAvailableClasses = mAvailableClasses.OrderBy(l => l.Name).ToList();
            lstClasses.Items.Clear();
            lstClasses.Items.AddRange(mAvailableClasses.Select(t => new ListViewItem(t.Name)).ToArray());

            // Clear the display of available methods
            mAvailableMethods = new MethodInfo[0];
            if (cmbSelectionPicker.SelectedIndex == METHODS)
            {
                lstMethods.Clear();
            }
        }
예제 #24
0
        private void listViewGameList_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            int gameID = int.Parse(this.listViewGameList.Items[e.Index].Tag.ToString());

            //选中游戏左边的复选框
            if (e.CurrentValue.ToString().ToLower().Equals("unchecked"))
            {
                //设置模块列表上面显示文字内容
                this.label4.Text = config.ReadConfigValue("MGM", "MR_UI_GamePower");
                //清楚上一次选中的游戏模块列表
                this.listView2.Items.Clear();
                //载入本次选中游戏的模块列表
                InitializeRoleList(gameID);
            }
            else            //撤销选中
            {
                //清楚上一次选中的游戏模块列表
                this.listView2.Items.Clear();
                //删除游戏下选中模块
                _ROLE[] rolelist = GetRoles(gameID, moduleListResult);
                for (int i = 0; i < rolelist.Length; i++)
                {
                    moduleIDs.Remove(rolelist[i].roleID);
                }
            }
        }
        void checkedListBoxMovies_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            int index = e.Index;
            MovieSelectItem item = (MovieSelectItem)checkedListBoxMovies.Items[index];
            if (item != null)
            {
                // Item state before item was clicked
                if (checkedListBoxMovies.GetItemChecked(index))
                {

                    // Store items changes
                    if (!unCheckedMovies.Contains(item))
                    {
                        unCheckedMovies.Add(item);
                    }
                    if (checkedMovies.Contains(item))
                    {
                        checkedMovies.Remove(item);
                    }

                }
                else
                {
                    // Store items changes
                    if (!checkedMovies.Contains(item))
                    {
                        checkedMovies.Add(item);
                    }
                    if (unCheckedMovies.Contains(item))
                    {
                        unCheckedMovies.Remove(item);
                    }
                }
            }
        }
예제 #26
0
		private void PersonalitiesListBox_ItemCheck(object sender, ItemCheckEventArgs e)
		{
			var p = PersonalitiesListBox.SelectedItem as Personality;
			if (p == null)
				return;
			p.EnabledUser = e.NewValue == CheckState.Checked;
		}
예제 #27
0
        private void processList_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (e.NewValue == CheckState.Checked)
            {

                string[] spliters = { "-" };

                string value = processList.Items[e.Index].ToString();

                string instanceName = value.Split(spliters, StringSplitOptions.None).FirstOrDefault();

                this.createperfcounter(instanceName);

                Series series = new Series(instanceName);

                series.ChartType = SeriesChartType.FastLine;

                series.BorderWidth = 5;

                Series cpuseries = new Series(instanceName);

                cpuseries.ChartType = SeriesChartType.FastLine;

                cpuseries.BorderWidth = 5;

                chart1.Series.Add(series);

                chart2.Series.Add(cpuseries);

            }
        }
예제 #28
0
        private void chkListDates_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            string date = this.chkListDates.Items[e.Index].ToString();
            if (e.NewValue == CheckState.Checked)
            {
                if (myDateList.Count == 5)
                {
                    e.NewValue = CheckState.Unchecked;
                    MessageBox.Show("对不起,你最多只能选择5个备选日期!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    if (!myDateList.Contains(date))
                    {
                        myDateList.Add(date);
                    }
                }
            }
            else
            {
                myDateList.Remove(date);
            }
            mf.myDateList = myDateList;
            mf.LoadDates();

        }
예제 #29
0
        /// <summary>
        /// Updates the disabledTables collection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lstTables_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            // Get the listviewitem that's been checked
            ListViewItem lvi = lstTables.Items[e.Index];

            // Only check table if it still exists
            if (pokerTables.ContainsKey(Convert.ToInt32(lvi.Tag)))
            {
                if (!lvi.Checked)
                {
                    // If it's checked, make sure the table isn't in the disabledTables collection
                    if (disabledTables.ContainsKey(lvi.Tag))
                    {
                        disabledTables.Remove(lvi.Tag);
                    }
                }
                else
                {
                    // If it isn't checked, make sure it's in the disabledTables collection
                    if (!disabledTables.ContainsKey(lvi.Tag))
                    {
                        disabledTables.Add(lvi.Tag, "");

                        // Reset the tables quadrant as the table can now be moved around without us knowing
                        pokerTables[Convert.ToInt32(lvi.Tag)].Quadrant = 0;
                    }
                }
            }
        }
예제 #30
0
        private void languagesCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            var lang = OSDbConfig.Languages[e.Index];
            switch (e.NewValue)
            {
                case CheckState.Unchecked:
                    if (UserLanguages.Contains(lang.Iso6392))
                    {
                        UserLanguages.Remove(lang.Iso6392);
                        Settings.Default.Save();
                    }
                    break;
                case CheckState.Checked:
                    if (!UserLanguages.Contains(lang.Iso6392))
                    {
                        UserLanguages.Add(lang.Iso6392);
                        Settings.Default.Save();
                    }
                    break;
            }

            var langs = UserLanguages
                .Cast<string>()
                .Select(code => OSDbConfig.Languages.FirstOrDefault(l => l.Iso6392.Equals(code)))
                .Where(l => l != null)
                .OrderBy(l => l.Name);

            languagesLabel.Text = $@"Selected languages: {string.Join(", ", langs.Select(l => l.Name))}";
        }
예제 #31
0
 private void m_lsvSampleResult_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (e.CurrentValue == System.Windows.Forms.CheckState.Unchecked)
     {
         m_objController.m_mthUniteDeviceCheckResult(e.Index);
     }
 }
예제 #32
0
 void checkedListBoxTo_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (!StopChangeSaveEnable)
     {
         buttonSave.Enabled = true;
     }
 }
예제 #33
0
 private void filters_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     for (int i = 0; i < checkBoxLFilter.Items.Count; i++)
     {
         if (i != e.Index) checkBoxLFilter.SetItemChecked(i, false);
     } 
 }
예제 #34
0
 private void messageBrowsingColumnsSelectedListView_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (e.NewValue == CheckState.Unchecked)
     {
         RemoveMessageBrowsingColumn((ListViewItem)messageBrowsingColumnsSelectedListView.Items[e.Index].Tag);
     }
 }
예제 #35
0
 private void FlagsCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     switch (e.Index)
     {
         case 0:
             z80.F ^= FlagMask.C;
             break;
         case 1:
             z80.F ^= FlagMask.N;
             break;
         case 2:
             z80.F ^= FlagMask.P;
             break;
         case 3:
             z80.F ^= FlagMask.B3;
             break;
         case 4:
             z80.F ^= FlagMask.H;
             break;
         case 5:
             z80.F ^= FlagMask.B5;
             break;
         case 6:
             z80.F ^= FlagMask.Z;
             break;
         case 7:
             z80.F ^= FlagMask.S;
             break;
     }
 }
예제 #36
0
 private void pluginsCLB_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (e.NewValue == CheckState.Checked)
     {
         var plugin = (pluginsCLB.Items[e.Index] as PluginInfo).CreateInstance(true);
         if (plugin is ParsedPacketsPlugin)
             (plugin as ParsedPacketsPlugin).OnClientPacketAdd += OnClientPacketAdd;
         if (plugin is L2ObjectsPlugin)
             (plugin as L2ObjectsPlugin).World = AccData.World;
         plugin.UserStopped += plugin_UserStopped;
         plugin.Run();
         AccData.LoadedPlugins.Add(plugin);
     }
     if (e.NewValue == CheckState.Unchecked && !uncheckFromCode)
     {
         var pluginInfo = pluginsCLB.Items[e.Index] as PluginInfo;
         Plugins.BasePlugin selectedPlugin = null;
         foreach (var plugin in AccData.LoadedPlugins)
             if (plugin.GetType().FullName == pluginInfo.Type.FullName)
             {
                 selectedPlugin = plugin;
                 break;
             }
         selectedPlugin.Stop();
         AccData.LoadedPlugins.Remove(selectedPlugin);
     }
 }
 private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     //since event fires before event change, we can assume that if some value is changing and all values are currently
     //all TRUE, then 1 must be changing to FALSE, so uncheck.
     if (checkedListBox1.CheckedItems.Count == checkedListBox1.Items.Count)
         checkBox3.Checked = false;
 }
        private void MyCheckedListBox_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            try
            {
                if (e.CurrentValue == CheckState.Unchecked && e.NewValue == CheckState.Checked)
                {
                    MyCheckedCounter++;
                }
                else if (e.CurrentValue == CheckState.Checked && e.NewValue == CheckState.Unchecked)
                {
                    MyCheckedCounter--;
                }

                if (MyCheckedCounter < 0)
                {
                    MyCheckedCounter = 0;
                }
                else if (MyCheckedCounter > TheCheckedListBox.Items.Count)
                {
                    MyCheckedCounter = TheCheckedListBox.Items.Count;
                }

                RefreshCounterText();
            }
            catch (Exception ex)
            {
                MessageManager.ShowError(ex, "Error when updating item status.", base.FindForm());
            }
        }
예제 #39
0
        private void chklbLayers_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            MapEditor.EditLayer layerType = MapEditor.EditLayer.Data;
            int layerNum = -1;
            GetLayerInfoFromIndex(e.Index, ref layerType, ref layerNum);

            switch (layerType)
            {
                case MapEditor.EditLayer.Data:
                    {
                        MapEditor.showDataLayer = (e.NewValue == CheckState.Checked);
                        break;
                    }
                case MapEditor.EditLayer.Ground:
                    {
                        MapEditor.showGroundLayer[layerNum] = (e.NewValue == CheckState.Checked);
                        break;
                    }
                case MapEditor.EditLayer.PropBack:
                    {
                        MapEditor.showPropBackLayer[layerNum] = (e.NewValue == CheckState.Checked);
                        break;
                    }
                case MapEditor.EditLayer.PropFront:
                    {
                        MapEditor.showPropFrontLayer[layerNum] = (e.NewValue == CheckState.Checked);
                        break;
                    }
                case MapEditor.EditLayer.Fringe:
                    {
                        MapEditor.showFringeLayer[layerNum] = (e.NewValue == CheckState.Checked);
                        break;
                    }
            }
        }
예제 #40
0
 void ColumnFirstText_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (e.NewValue == CheckState.Checked)
         InvokeCheckStatusSwitched(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, true));
     else if (e.NewValue == CheckState.Unchecked)
         InvokeCheckStatusSwitched(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, false));
 }
예제 #41
0
        /// <summary>
        /// Handle not changing checked state of item when double clicking to edit it.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>

        private void lstExclusions_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (inhibitAutoCheck)
            {
                e.NewValue = e.CurrentValue;
            }
        }
예제 #42
0
        protected void selectListDicom_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            string selected = selectListDicom.SelectedItem.ToString();
            dcm    item     = new dcm(sys.dicomsPath + selected.Substring(selected.LastIndexOf('|') + 1));

            Details.Text = item.patientName + Environment.NewLine + convToDate(item.dateOfScan) + Environment.NewLine + convToTime(item.timeOfScan) + Environment.NewLine + item.frameNum;
        }
예제 #43
0
파일: form1.cs 프로젝트: zhimaqiao51/docs
    //</snippet2>


    //<snippet3>
    // Handles the ItemChecked event.  The method loops through all the
    // checked items and tallies a new price each time an item is
    // checked or unchecked. It outputs the price to TextBox1.
    private void ListView1_ItemCheck2(object sender,
                                      System.Windows.Forms.ItemCheckEventArgs e)
    {
        double price = 0.0;

        ListView.CheckedListViewItemCollection checkedItems =
            ListView1.CheckedItems;

        foreach (ListViewItem item in checkedItems)
        {
            price += Double.Parse(item.SubItems[1].Text);
        }
        if (e.CurrentValue == CheckState.Unchecked)
        {
            price += Double.Parse(
                this.ListView1.Items[e.Index].SubItems[1].Text);
        }
        else if ((e.CurrentValue == CheckState.Checked))
        {
            price -= Double.Parse(
                this.ListView1.Items[e.Index].SubItems[1].Text);
        }
        // Output the price to TextBox1.
        TextBox1.Text = price.ToString();
    }
예제 #44
0
 private void ChannelMap_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (Settings.IsLoading == false)
     {
         List <int> listofmap = new List <int>();
         if (ChannelMap.Items.Count > 0)
         {
             for (int a = 0; a <= ChannelMap.Items.Count - 1; a++)
             {
                 try
                 {
                     //   MsgBox(e.Index & " : " & e.NewValue)
                     if (e.Index == a)
                     {
                         if ((e.NewValue == System.Windows.Forms.CheckState.Checked))
                         {
                             listofmap.Add(a);
                         }
                     }
                     else
                     {
                         if (ChannelMap.GetItemChecked(a))
                         {
                             listofmap.Add(a);
                         }
                     }
                 }
                 catch (Exception ex)
                 {
                 }
             }
         }
         Settings.CardMap = listofmap;
     }
 }
예제 #45
0
//UPGRADE_WARNING: ListBox event lstUtilizationFields.ItemCheck has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
        private void lstUtilizationFields_ItemCheck(System.Object eventSender, System.Windows.Forms.ItemCheckEventArgs eventArgs)
        {
            object sid = null;
            int    fid = 0;

            if (openning == 0)
            {
                //UPGRADE_WARNING: Couldn't resolve default property of object sid. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                sid = Microsoft.VisualBasic.Compatibility.VB6.Support.GetItemData(My.MyProject.Forms.frmIndicatorReportSetup.lstHeading, My.MyProject.Forms.frmIndicatorReportSetup.lstHeading.SelectedIndex);
                fid = Microsoft.VisualBasic.Compatibility.VB6.Support.GetItemData(lstUtilizationFields, lstUtilizationFields.SelectedIndex);
                if (lstUtilizationFields.GetItemChecked(eventArgs.Index) == true)
                {
                    modGlobal.gv_sql = "INSERT into tbl_Setup_IndicatorReportDenominators (SubGroupID, tName, FieldID, OpChar)";
                    //UPGRADE_WARNING: Couldn't resolve default property of object sid. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    modGlobal.gv_sql = modGlobal.gv_sql + " values (" + sid + ",'Utilization'," + Microsoft.VisualBasic.Compatibility.VB6.Support.GetItemData(lstUtilizationFields, lstUtilizationFields.SelectedIndex) + " , 1)";
                    modGlobal.gv_cn.Execute(modGlobal.gv_sql);
                }
                else
                {
                    modGlobal.gv_sql = "delete from tbl_Setup_IndicatorReportDenominators ";
                    //UPGRADE_WARNING: Couldn't resolve default property of object sid. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                    modGlobal.gv_sql = modGlobal.gv_sql + " where SubGroupID = " + sid + " and  tName = 'Utilization' and FieldID =" + fid;
                    modGlobal.gv_cn.Execute(modGlobal.gv_sql);
                }
            }
        }
예제 #46
0
 private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (e.NewValue == CheckState.Checked)
     {
         checkeditems.Add(e.Index);
         if (("," + textBox1.Text + ",").Contains("," + checkedListBox1.Items[e.Index].ToString() + ","))
             return;
         if (string.IsNullOrEmpty(textBox1.Text))
         {
             textBox1.Text += checkedListBox1.Items[e.Index].ToString();
         }
         else
         {
             textBox1.Text += "," + checkedListBox1.Items[e.Index].ToString();
         }
     }
     else
     {
         checkeditems.Remove(e.Index);
         string s = textBox1.Text;
         s = "," + s + ",";
         s = s.Replace("," + checkedListBox1.Items[e.Index].ToString() + ",", ",");
         if (s.StartsWith(","))
             s = s.Substring(1, s.Length - 1);
         if (s.EndsWith(","))
             s = s.Substring(0, s.Length - 1);
         textBox1.Text = s;
     }
 }
예제 #47
0
        /// <summary>
        /// Called if the user changes the check state of an item
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event parameter</param>
        private void lvTypes_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            if (!_exclusiveUpdate)
            {
                ListViewItem lvCheck = lvTypes.Items[e.Index];

                InformationType iT = lvCheck.Tag as InformationType;

                if (iT != null)
                {
                    if ((iT.Mode == InformationTypeMode.Exclusive) && (e.NewValue == CheckState.Checked))
                    {
                        _exclusiveUpdate = true;
                        CheckExclusive(lvCheck);
                        _exclusiveUpdate = false;
                        return;
                    }
                    else if ((iT.Mode == InformationTypeMode.Exclusive) && (e.NewValue == CheckState.Unchecked))
                    {
                        _liExclusive = null;
                        return;
                    }
                }

                if (_liExclusive != null)
                {
                    _exclusiveUpdate = true;
                    CheckExclusive(null);
                    _exclusiveUpdate = false;
                }
            }
        }
        private void lvDeposit_ItemCheck(System.Object eventSender, System.Windows.Forms.ItemCheckEventArgs eventArgs)
        {
            System.Windows.Forms.ListViewItem Item = lvDeposit.Items[eventArgs.Index];
            string lString = null;

            if (Item.Checked)
            {
                //UPGRADE_WARNING: Lower bound of collection Item has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
                if (Item.SubItems.Count > 2)
                {
                    Item.SubItems[2].Text = Item.Text;
                }
                else
                {
                    Item.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, Item.Text));
                }
                modRecordSet.cnnDB.Execute("INSERT INTO SupplierDepositLnk (SupplierDepositLnk_SupplierID, SupplierDepositLnk_DepositID, SupplierDepositLnk_Type, SupplierDepositLnk_Name) VALUES (" + gID + ", " + Strings.Mid(Item.Name, 3) + ", " + Strings.Mid(Item.Name, 2, 1) + ", '" + Strings.Replace(Item.Text, "'", "''") + "')");
            }
            else
            {
                modRecordSet.cnnDB.Execute("DELETE FROM SupplierDepositLnk WHERE SupplierDepositLnk_SupplierID = " + gID + " AND SupplierDepositLnk_DepositID = " + Strings.Mid(lvDeposit.FocusedItem.Name, 3) + " AND SupplierDepositLnk_Type = " + Strings.Mid(lvDeposit.FocusedItem.Name, 2, 1));
                //UPGRADE_WARNING: Lower bound of collection Item has changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A3B628A0-A810-4AE2-BFA2-9E7A29EB9AD0"'
                if (Item.SubItems.Count > 2)
                {
                    Item.SubItems[2].Text = "";
                }
                else
                {
                    Item.SubItems.Insert(2, new System.Windows.Forms.ListViewItem.ListViewSubItem(null, ""));
                }
            }
        }
예제 #49
0
 private void cklbdieukien_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     int index = cklbdieukien.SelectedIndex;
     if (cklbdieukien.GetItemChecked(index) == false && cklbdieukien.CheckedItems.Count == cklbdieukien.Items.Count - 1)
         btnxetduyet.Enabled = true;
     else
         btnxetduyet.Enabled = false;
 }
예제 #50
0
 protected override void OnItemCheck(ItemCheckEventArgs e)
 {
     base.OnItemCheck(e);
     if (_isUpdatingCheckStates)
         return;
     FlagCheckedListBoxItem item = Items[e.Index] as FlagCheckedListBoxItem;
     UpdateCheckedItems(item, e.NewValue);
 }
예제 #51
0
        private void listAlunos_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            var items = listAlunos.Items;

            ChamadaAlunoDTO itemSelecionado = _chamada.Alunos[e.Index];

            itemSelecionado.Status = e.NewValue == CheckState.Checked ? "C" : "F";
        }
예제 #52
0
 private void checkedListBoxFilecheck_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     int index = e.Index, i;
     if (e.NewValue == CheckState.Checked)
     {
         for (i = 0; i < 4; i++) { if (i != index) checkedListBoxFilecheck.SetItemChecked(i, false); }
     }
 }
 public void RaiseDeviceTypeCheck(int index, CheckState newCheckValue, CheckState currentValue)
 {
     ItemCheckEventArgs args = new ItemCheckEventArgs(index, newCheckValue, currentValue);
     if (null != DeviceTypeCheck)
     {
         DeviceTypeCheck(this, args);
     }
 }
예제 #54
0
 private void OnItemChecked(object sender, SWF.ItemCheckEventArgs args)
 {
     if (args.Index == ((ListItemProvider)Provider).Index)
     {
         newValue = args.NewValue;
         RaiseAutomationPropertyChangedEvent();
     }
 }
예제 #55
0
 private void LogTypesChklist_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (_initComplete)
     {
         _trigger.SetLogType((GameLogTypes)LogTypesChklist.Items[e.Index], e.NewValue);
         ApplicableLogsDisplayTxtbox.Text = _trigger.LogTypesAspect;
     }
 }
예제 #56
0
 private void statusesCheckedListBox_ItemCheck( object sender, ItemCheckEventArgs e )
 {
     if( !ignoreChanges )
     {
         ReflectionHelpers.SetFlag( statuses, Statuses.FieldNames[e.Index], e.NewValue == CheckState.Checked );
         OnDataChanged( this, System.EventArgs.Empty );
     }
 }
예제 #57
0
 void availLayersView_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (this.bListViewClicked)
     {
         this.msLm.switchLayerVisibility(e.Index);
         this.mainControler.MapPanel.Invalidate();
     }
 }
 //Override the ItemCheck event with our own
 protected override void OnItemCheck(System.Windows.Forms.ItemCheckEventArgs ice)
 {
     //Allow checks to be changed only if AutoCheck = True
     if (AllowChecks == false)
     {
         ice.NewValue = ice.CurrentValue;
     }
 }
예제 #59
0
 private void lstSiteList_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
 {
     if (bLoadedState && thisRefreshTimer != null)
     {
         thisRefreshTimer.Interval = 500;
         thisRefreshTimer.Start();
     }
 }
예제 #60
0
 private void browserCheckBox_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     for (int indices = 0; indices < browserCheckBox.Items.Count; indices++) {
         if (e.Index != indices) {
             browserCheckBox.SetItemChecked(indices, false);
         }
     }
 }