Sunday, 15 July 2012

vb.net - Set the Image On Button of DataGridViewButtonColumn -



vb.net - Set the Image On Button of DataGridViewButtonColumn -

how set normal , pressed image button of datagridviewbuttoncolumn i'm using image button i'm able set image button how set pressed image.

actually want button clickable should have image , after click image should change. please @ image below.

before

after

try in cellcontentclick event , example, hope can idea.

private void datagridview2_cellcontentclick(object sender, datagridviewcelleventargs e) { if (e.columnindex == 1) //where datagridviewbuttoncolumn index { if (datagridview2[e.columnindex, e.rowindex].editedformattedvalue.tostring().length > 0) { if (datagridview2[e.columnindex, e.rowindex].editedformattedvalue.tostring() == "start") { datagridview2[e.columnindex, e.rowindex].value = "stop"; } else { datagridview2[e.columnindex, e.rowindex].value = "start"; } } else datagridview2[e.columnindex, e.rowindex].value = "start"; } }

vb.net winforms datagridview

No comments:

Post a Comment