Developer111
Member
- Joined
- Apr 21, 2010
- Messages
- 24
- Programming Experience
- 5-10
Hi,
I converted a VB6 application in VB.net 2008 by using VS 2008 conversion wizard I have encountered a problem in using Tab control in VB.net. I used “Microsoft TabStrip Control 6.0 (SP6)” in VB 6 project. VB.net converter wizard converted it properly and add reference to “AxInterop.MSComctlLib.dll” and “Interop.MSComctlLib.dll”. I am using TabStrip on a Form that is use “Hide” instead of “Close”. So problem is when this form shown again following instruction raises exception:
a = tbsMain.SelectedItem.Index
Exception: NullReferenceException was unhandled “Object reference not set to an instance of an object.”
But when I browse the selected item’s index value using “Quick Watch” option (while debugging) it returns the correct index instead of nothing value. I am unable to understand what is the problem and is restricted to use only this control. While debugging when I browse SelectedItem property in “tbsMain”, it contains an object of “MSComctlLib.TabClass”, I think when “Hide” the Form reference of this object’s memory location is lost but this is just an assumption. I have also attached a demo project to demonstrate the problem.
Regards,
Hassan
I converted a VB6 application in VB.net 2008 by using VS 2008 conversion wizard I have encountered a problem in using Tab control in VB.net. I used “Microsoft TabStrip Control 6.0 (SP6)” in VB 6 project. VB.net converter wizard converted it properly and add reference to “AxInterop.MSComctlLib.dll” and “Interop.MSComctlLib.dll”. I am using TabStrip on a Form that is use “Hide” instead of “Close”. So problem is when this form shown again following instruction raises exception:
a = tbsMain.SelectedItem.Index
Exception: NullReferenceException was unhandled “Object reference not set to an instance of an object.”
But when I browse the selected item’s index value using “Quick Watch” option (while debugging) it returns the correct index instead of nothing value. I am unable to understand what is the problem and is restricted to use only this control. While debugging when I browse SelectedItem property in “tbsMain”, it contains an object of “MSComctlLib.TabClass”, I think when “Hide” the Form reference of this object’s memory location is lost but this is just an assumption. I have also attached a demo project to demonstrate the problem.
Regards,
Hassan
Attachments
Last edited by a moderator: