And it also raises the exception "Cross-thread operation not valid: Control 'explorerBar1' accessed from a thread other than the thread it was created on." although I am not calling the form which contains explorerBar1 so I am baffled.
This is the last lines of the disassembly which I cannot figure out.
The problem is raised when I quickly click on treeview items which shows the form associated with it via its tag property. This is the code which calls the form.000000ac mov edx,dword ptr [ebp-8]
000000af call FF74DC7B
000000b4 mov edx,eax
000000b6 mov ecx,esi
000000b8 call FF71A9AB
000000bd mov ecx,esi
000000bf call FF71E2E3
000000c4 int 3
CSharp Code:
private void item_Click(object sender) { Assembly asm = Assembly.LoadFrom(Assembly.GetExecutingAssembly().GetName().CodeBase); Common.CommonFunctions.Busy(true); if (e.Item.Tag != null) { string formName = string.Empty; foreach (Form f in this.MdiChildren) { formName = f.Name; if (formName == e.Item.Tag.ToString()) { f.Activate(); this.Focus(); return; } else f.close(); } Type formObject = asm.GetType("ApplicationLayer." + e.Item.Tag.ToString()); Object formActivator = Activator.CreateInstance(formObject); Form frm = formActivator as Form; frm.MdiParent = this; frm.Show(); this.Focus(); } Common.CommonFunctions.Busy(false); }
Could anyone help me out on looking for the cause of the error and fixing it?
EDIT:
After a few more testing it still shows the above disassemply I quoted, could anyone figure out what the message is?




Reply With Quote