void CreateTab(string tabname, string lvname, GetItemDelegate gidel,GetCollection gcdel)
 {
     if (tabControl1.TabPages.ContainsKey(tabname))
     {
         currentView = (EnhancedListView)tabControl1.Controls[lvname];
     }
     else
     {
         if (gidel == null)
             return;
         TabPage newTP = new TabPage(tabname);
         newTP.Name = tabname;
         currentView = new EnhancedListView();
         currentView.FullRowSelect = true;
         currentView.GridLines = true;
         currentView.Name = lvname;
         currentView.TabIndex = 0;
         currentView.UseCompatibleStateImageBehavior = false;
         currentView.View = View.Details;
         currentView.VirtualMode = true;
         currentView.Dock = DockStyle.Fill;
         currentView.SetCallback(gidel);
         currentView.Tag = gcdel;
         currentView.ContextMenuStrip = contextMenuStrip1;
         newTP.Controls.Add(currentView);
         tabControl1.TabPages.Add(newTP);
     }
     tabControl1.SelectTab(tabname);
 }
        private void UpdateSqlView()
        {
            if (msm.MsgList != null && msm.MsgList.Count > 0)
            {
                currentView = GetTabLv("MySQL", "sqlView");
                currentView.VirtualListSize = 0;
                UpdateSqlViewColumns();
                currentView.Invoke((ChangeProgressNotifier)delegate(int cnt)
                 {
                     currentView.ClearCache();
                     currentView.VirtualListSize = cnt;
                     currentView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                     currentView.Refresh();
                 }, msm.MsgList.Count);

            }
        }