Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,I use a user control in a tab document. the problem is when I close tab, user control load event, will raise.
I used this code to add my user control to rad dock(telerik tab document component)
when I try to close "DWTimeCard ","UC_3TimeCard" load event will raise!!!
C#
private void CreateTimeCardTab(UC_3TimeCard Frm)
       {
           DocumentWindow DWTimeCard = new DocumentWindow();
           DWTimeCard.Text = "";
           DWTimeCard.Name = "DWTimeCard";
           DWTimeCard.CloseAction = DockWindowCloseAction.CloseAndDispose;
           DWTimeCard.Disposed += new EventHandler(DWTimeCard_Disposed);
           Frm.DataAvailable+=new EventHandler(ListShow_DataAvailable);
           this.radDock1.AddDocument(DWTimeCard);
           this.radDock1.ActiveWindow = DWTimeCard;
           DWTimeCard.Controls.Add(Frm);
           Frm.Dock = DockStyle.Fill;
           Flag_DWTimeCard = true;
           Frm.Show();
       }
       void DWTimeCard_Disposed(object sender, EventArgs e)
       {
           Flag_DWTimeCard = false;
       }
Posted
Updated 20-Jul-14 19:25pm
v6
Comments
Dilan Shaminda 21-Jul-14 1:06am    
can you please explain it more?
dan!sh 21-Jul-14 1:10am    
It should not raise load event unless you intend to when the tab is closing. What is it that you are trying to accomplish?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900