I'm stumped.
I load add-ins at run time. Each Add-In has a collection of
UserControls. These UserControls are then added to a TabControl as
TabPages. The UserControls are created in the Add-In's ctor.
Here's the code that loads the Tab Control when the add-in is selected
from a List;
private void LoadTabPages(string AddInName)
{
tabControl1.TabPages.Clear();
//addIns is a Dictionary<string, IAddIn>
IAddIn addIn = addIns[AddInName];
if(addIn == null)
return;
foreach (UserControl ctr in parser.TabForms)
{
TabPage t = new TabPage(addIn.Tag.ToString());
ctr.Dock = DockStyle.Fill;
tabControl1.TabPages.Add(t);
t.Controls.Add(addIn);
}
}
It works fine, except that I cannot get the Add-In to update its own
listview after it's already been selected from the List.
Example of when it works
1. Start App
2. Run process that adds to the Add-In's ListView
3. Select that Add-In from a list
4. The Addin's UserControl (with ListView) is added to a TabControl as
a TabPage
5. All the data is present in the ListView
Example of when it does not
1. Start App
2. Select that Add-In from a list
3. The Addin's UserControl (with ListView) is added to a TabControl as
a TabPage
4. Run process that adds to the Add-In's ListView
5. No Data is shown in the ListView
But the stickler is, when I step through the code, the ListView clearly
shows Items present, they are just not being displayed. >:|
I've tried using
PerformLayout();
ResumeLayout();
Invalidate();
Refresh();
etc, but nothing works.
Please Help.
I'll gladly post more code if needed.