Type | Description | |||
State as CheckStateEnum | A CheckStateEnum expression that defines the state of the check box being changed. 0 - unchecked, 1 - checked, 2 - partial checked. | |||
Long | A long expression that indicates the index of the icon used. The last 7 bits in the high significant byte of the long expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. If the index is not valid the default icon is used. |
Use CheckImage and RadioImage properties to define icons for radio and check box cells. The CheckImage property defines the index of the icon being used by check boxes. Use the CellHasCheckBox property to assign a checkbox to a cell. Use the CellHasRadioButton property to assign a radio button to a cell. Use the CellImage or CellImages property to assign one or multiple icons to a cell. Use the CellPicture property to assign a picture to a cell. Use the CellStateChanged event to notify your application when the cell's state is changed. Use the PartialCheck property to allow partial check feature within the column. Use the Images method to load icons at runtime.
The following VB sample defines icons for the cells of check box type:
With Grid1 .BeginUpdate .Columns.Add "Radio" For i = 0 To 2 Dim h As HITEM h = .Items.AddItem("Option " & i) .Items.CellHasCheckBox(h) = True .Items.CellState(h) = i Mod 2 Next .CheckImage(0) = 1 .CheckImage(1) = 3 .EndUpdate End With
The following C++ sample changes the default appearance for check boxes:
CString s = "gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUnAktg8ulsImMvmUwm01nE0nUznk3nc+ns5oM/oVAo1FpFEpVDplHnUrqFRqVTqkrptJq9Lp1ZmdVr1fsEYrthslls1ntEqmaZM0YtlutoAt9yuNzu11vFwvV0sVOu97v98wWBwl5qNrw2FwGJxmLtOPyF9hFzeOVAGVeOXy2YiT/zufh+gh2fudZymb1GZ0"; s = s + "Or0esz2u0lxqGIjGc22W2G51u71+jueR4Fl2gAdXFzWZ2/I3G80W952C01x5PH6m65/WwWzl2n5Xd6vM7Gw3/B8le4fFdXE43T6fh5mlv1x9HU6YzTIz5v58Wyq3b+T1tS6hmPw/TwPe/jywSw7/Iw+cHQA7z2wM574KSucHvSzj7PxDYAQ690KQQlkGPU9L5s5AaMRSAEVxA2MFRhBbJriccaxLG8TwDCTrt8uLowa4z5w7Ib7w9IsPwnF8ZMFD"; s = s + "EWQJFcoSfAkXPHGMrJ0ucanGAEtRxIMIPpAL9skpUsxtIUjyLDU0w5IrsSrEcZoxLr5yi2rLTtJyMTfEUrwU4cu0DM8vxNMD2OWz0KzLGkbS7DsmzXNtJPzOCNUBRsbRXSE8SlFUpwPP0/OGbtSS5TEtzpQkb0O71FKHM1UVPL1Cwyy0iPwzjQ0qjNL1jX1Z1XTlPTu1Ue1DK7hmvZQAVIbtTV/VNaWDCLLVcn1YWfbNo2BSMwszXcyWxQVfybHL"; s = s + "MxW6dwWOyNk2XZRr2ZUtx2zctDWrHz4znWV523TdqW/PteRJfl90HaVzW87N1wTdt4XeAGH2bbVZXrWuATJV9GWhgtyVVhDOXVXuJ43juD3ti+Fz/EjFMGxuWsc6F85fmeWZqw0f5pl2bZhayEZStCuK3oSsaGrWiaPo2k6DpGl6Up2frOiofJXqaOo+kKMpIkiNEAtLXNCzuwEAAex7GjGy7IgwAbRs217Ttu2bVuOz7fuW67ptG8bTvW4bvt28"; s = s + "7C0YAICA"; m_grid.Images(COleVariant(s)); m_grid.SetCheckImage(0,1); m_grid.SetCheckImage(1,2); m_grid.SetCheckImage(2,3);
The following C# sample changes the default appearance for check boxes:
string s = "gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUnAktg8ulsImMvmUwm01nE0nUznk3nc+ns5oM/oVAo1FpFEpVDplHnUrqFRqVTqkrptJq9Lp1ZmdVr1fsEYrthslls1ntEqmaZM0YtlutoAt9yuNzu11vFwvV0sVOu97v98wWBwl5qNrw2FwGJxmLtOPyF9hFzeOVAGVeOXy2YiT/zufh+gh2fudZymb1GZ0"; s = s + "Or0esz2u0lxqGIjGc22W2G51u71+jueR4Fl2gAdXFzWZ2/I3G80W952C01x5PH6m65/WwWzl2n5Xd6vM7Gw3/B8le4fFdXE43T6fh5mlv1x9HU6YzTIz5v58Wyq3b+T1tS6hmPw/TwPe/jywSw7/Iw+cHQA7z2wM574KSucHvSzj7PxDYAQ690KQQlkGPU9L5s5AaMRSAEVxA2MFRhBbJriccaxLG8TwDCTrt8uLowa4z5w7Ib7w9IsPwnF8ZMFD"; s = s + "EWQJFcoSfAkXPHGMrJ0ucanGAEtRxIMIPpAL9skpUsxtIUjyLDU0w5IrsSrEcZoxLr5yi2rLTtJyMTfEUrwU4cu0DM8vxNMD2OWz0KzLGkbS7DsmzXNtJPzOCNUBRsbRXSE8SlFUpwPP0/OGbtSS5TEtzpQkb0O71FKHM1UVPL1Cwyy0iPwzjQ0qjNL1jX1Z1XTlPTu1Ue1DK7hmvZQAVIbtTV/VNaWDCLLVcn1YWfbNo2BSMwszXcyWxQVfybHL"; s = s + "MxW6dwWOyNk2XZRr2ZUtx2zctDWrHz4znWV523TdqW/PteRJfl90HaVzW87N1wTdt4XeAGH2bbVZXrWuATJV9GWhgtyVVhDOXVXuJ43juD3ti+Fz/EjFMGxuWsc6F85fmeWZqw0f5pl2bZhayEZStCuK3oSsaGrWiaPo2k6DpGl6Up2frOiofJXqaOo+kKMpIkiNEAtLXNCzuwEAAex7GjGy7IgwAbRs217Ttu2bVuOz7fuW67ptG8bTvW4bvt28"; s = s + "7C0YAICA"; axGrid1.Images(s); axGrid1.set_CheckImage( 0,1 ); axGrid1.set_CheckImage( 1,2 ); axGrid1.set_CheckImage( 2,3 );
The following VB.NET sample changes the default appearance for check boxes:
With AxGrid1 Dim s As String = "gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUnAktg8ulsImMvmUwm01nE0nUznk3nc+ns5oM/oVAo1FpFEpVDplHnUrqFRqVTqkrptJq9Lp1ZmdVr1fsEYrthslls1ntEqmaZM0YtlutoAt9yuNzu11vFwvV0sVOu97v98wWBwl5qNrw2FwGJxmLtOPyF9hFzeOVAGVeOXy2YiT/zufh+gh2fudZymb1GZ0" s = s + "Or0esz2u0lxqGIjGc22W2G51u71+jueR4Fl2gAdXFzWZ2/I3G80W952C01x5PH6m65/WwWzl2n5Xd6vM7Gw3/B8le4fFdXE43T6fh5mlv1x9HU6YzTIz5v58Wyq3b+T1tS6hmPw/TwPe/jywSw7/Iw+cHQA7z2wM574KSucHvSzj7PxDYAQ690KQQlkGPU9L5s5AaMRSAEVxA2MFRhBbJriccaxLG8TwDCTrt8uLowa4z5w7Ib7w9IsPwnF8ZMFD" s = s + "EWQJFcoSfAkXPHGMrJ0ucanGAEtRxIMIPpAL9skpUsxtIUjyLDU0w5IrsSrEcZoxLr5yi2rLTtJyMTfEUrwU4cu0DM8vxNMD2OWz0KzLGkbS7DsmzXNtJPzOCNUBRsbRXSE8SlFUpwPP0/OGbtSS5TEtzpQkb0O71FKHM1UVPL1Cwyy0iPwzjQ0qjNL1jX1Z1XTlPTu1Ue1DK7hmvZQAVIbtTV/VNaWDCLLVcn1YWfbNo2BSMwszXcyWxQVfybHL" s = s + "MxW6dwWOyNk2XZRr2ZUtx2zctDWrHz4znWV523TdqW/PteRJfl90HaVzW87N1wTdt4XeAGH2bbVZXrWuATJV9GWhgtyVVhDOXVXuJ43juD3ti+Fz/EjFMGxuWsc6F85fmeWZqw0f5pl2bZhayEZStCuK3oSsaGrWiaPo2k6DpGl6Up2frOiofJXqaOo+kKMpIkiNEAtLXNCzuwEAAex7GjGy7IgwAbRs217Ttu2bVuOz7fuW67ptG8bTvW4bvt28" s = s + "7C0YAICA" .Images(s) .set_CheckImage(0, 1) .set_CheckImage(1, 2) .set_CheckImage(2, 3) End With
The following VFP sample changes the default appearance for check boxes:
with thisform.Grid1 local s s = "gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUnAktg8ulsImMvmUwm01nE0nUznk3nc+ns5oM/oVAo1FpFEpVDplHnUrqFRqVTqk" s = s + "rptJq9Lp1ZmdVr1fsEYrthslls1ntEqmaZM0YtlutoAt9yuNzu11vFwvV0sVOu97v98wWBwl5qNrw2FwGJxmLtOPyF9hFzeOVAGVeOXy2YiT/zufh+gh2fudZymb1GZ0" s = s + "Or0esz2u0lxqGIjGc22W2G51u71+jueR4Fl2gAdXFzWZ2/I3G80W952C01x5PH6m65/WwWzl2n5Xd6vM7Gw3/B8le4fFdXE43T6fh5mlv1x9HU6YzTIz5v58Wyq3b+T1" s = s + "tS6hmPw/TwPe/jywSw7/Iw+cHQA7z2wM574KSucHvSzj7PxDYAQ690KQQlkGPU9L5s5AaMRSAEVxA2MFRhBbJriccaxLG8TwDCTrt8uLowa4z5w7Ib7w9IsPwnF8ZMFD" s = s + "EWQJFcoSfAkXPHGMrJ0ucanGAEtRxIMIPpAL9skpUsxtIUjyLDU0w5IrsSrEcZoxLr5yi2rLTtJyMTfEUrwU4cu0DM8vxNMD2OWz0KzLGkbS7DsmzXNtJPzOCNUBRsbR" s = s + "XSE8SlFUpwPP0/OGbtSS5TEtzpQkb0O71FKHM1UVPL1Cwyy0iPwzjQ0qjNL1jX1Z1XTlPTu1Ue1DK7hmvZQAVIbtTV/VNaWDCLLVcn1YWfbNo2BSMwszXcyWxQVfybHL" s = s + "MxW6dwWOyNk2XZRr2ZUtx2zctDWrHz4znWV523TdqW/PteRJfl90HaVzW87N1wTdt4XeAGH2bbVZXrWuATJV9GWhgtyVVhDOXVXuJ43juD3ti+Fz/EjFMGxuWsc6F85f" s = s + "meWZqw0f5pl2bZhayEZStCuK3oSsaGrWiaPo2k6DpGl6Up2frOiofJXqaOo+kKMpIkiNEAtLXNCzuwEAAex7GjGy7IgwAbRs217Ttu2bVuOz7fuW67ptG8bTvW4bvt28" s = s + "7C0YAICA" .Images(s) .CheckImage(0) = 1 .CheckImage(1) = 2 .CheckImage(2) = 3 endwith
The following template can be placed on the control's Template page:
Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmU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