System.Windows.Forms.CheckedListBox.GetItemCheckState C# (CSharp) Method

GetItemCheckState() public method

public GetItemCheckState ( int index ) : CheckState
index int
return CheckState
		public CheckState GetItemCheckState (int index)
		{
			if (index < 0 || index >= Items.Count)
				throw new ArgumentOutOfRangeException ("Index of out range");

			object o = Items [index];
			if (check_states.Contains (o))
				return (CheckState) check_states [o];
			else
				return CheckState.Unchecked;
		}

Usage Example

        public void DrawAllLayers(Graphics aGfx, int lX, int lY, int lW, int lH)
        {
            for (int i = 0; i < mlstTileLayers.Count; i++)
            {
                if (objLayerList.GetItemCheckState(i) == CheckState.Checked)
                {
                    bool bGrid = false;

                    if (mlSelectedLayer == i && mMainForm.objTileGridCheckBox.Checked)
                    {
                        bGrid = true;
                    }

                    ((cTileLayer)mlstTileLayers[i]).Draw(aGfx, lX, lY, lW, lH, bGrid);
                }
            }
        }
All Usage Examples Of System.Windows.Forms.CheckedListBox::GetItemCheckState