c# - Setting focus to listviews in the tabcontrol of a winform -
in project, in form there 2 list views in tabcontrol, unable set focus both list view items. using following code. problem able select 1 listview among both. please tell me alternative can select both listviews in form.
private void tabcontrol1_selectedindexchanged(object sender, eventargs e) { binddata1(); if (listviewclients.items.count > 0) { listviewclients.items[0].selected = true; listviewclients.select(); } if (listview1.items.count > 0) { listview1.items[0].selected = true; listview1.select(); } }
private void tabcontrol1_selectedindexchanged(object sender, eventargs e) { binddata1(); switch (this.tabcontrol1.selectedtab.name) { case "tpupdate": listviewclients.items[0].selected = true; listviewclients.select(); break; case "tpdelete": listview1.items[0].selected = true; listview1.select(); break; } }
Comments
Post a Comment