mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Added NavigateToTabPage function to TabToListView
This commit is contained in:
parent
341d430052
commit
c1bd044ec0
1 changed files with 13 additions and 8 deletions
|
@ -141,15 +141,20 @@ private void lvMain_SelectedIndexChanged(object sender, EventArgs e)
|
|||
{
|
||||
ListViewItem lvi = lvMain.SelectedItems[0];
|
||||
TabPage tabPage = lvi.Tag as TabPage;
|
||||
NavigateToTabPage(tabPage);
|
||||
}
|
||||
}
|
||||
|
||||
if (tabPage != null && !tcMain.TabPages.Contains(tabPage))
|
||||
{
|
||||
tcMain.TabPages.Clear();
|
||||
tcMain.TabPages.Add(tabPage);
|
||||
// Need to set ImageKey again otherwise icon not show up
|
||||
tabPage.ImageKey = lvi.ImageKey;
|
||||
lvMain.Focus();
|
||||
}
|
||||
public void NavigateToTabPage(TabPage tabPage)
|
||||
{
|
||||
if (tabPage != null && !tcMain.TabPages.Contains(tabPage))
|
||||
{
|
||||
tcMain.TabPages.Clear();
|
||||
tcMain.TabPages.Add(tabPage);
|
||||
// Need to set ImageKey again otherwise icon not show up
|
||||
tabPage.ImageKey = tabPage.ImageKey;
|
||||
tabPage.Refresh();
|
||||
lvMain.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue