Windows Develop Bookmark and Share   
 index > Windows Forms General > Windows Forms Inheritance Bug ?
 

Windows Forms Inheritance Bug ?

I have a 3 level inheritance.

class Level1 : System.Windows.Forms {}
class Level2: Level1{}
class Level3 : Level2 {}

in the load event from Level1 I call a overidable method, that in Level2 is override and in this I make some initialization for information on the form, DataBinding and one SqlDataAdapter, but when I whant to see the designer for the Level3 the designer show me errors, why?

If this a problem in my whay of programming or must placed an attribute before the method, please write my what I must write.

Thanks,

Claudiu

ctescu  Tuesday, February 07, 2006 8:14 AM
Is no aditional cod in constructor, and the problem, the bug is that the .Net not respond at anything, (task manager) - not responding, and the computer that I test have processor of 1,7GHz and 1Gb RAM.
ctescu  Tuesday, February 07, 2006 2:31 PM
Can you provide the sourcecode (constructors and Load only), and show us the error message that the designer gives?
Jelle van der Beek2  Tuesday, February 07, 2006 11:29 AM

1) publicclass Level1
inherits System.Windows.Forms

protected overridable SubLoadInformation()
'no code
end sub

private sub form_load(sender as object,e as EventArgs) Handles MyBase.Load
LoadInformation()
end sub

end class

2) public class Level2
inherits Level1

protected overrides Sub LoadInformation()
Dim sqlDataAdapter as new SqlDataAdapter(..,...)
sqlDataAdapter.Fill(_dataSet)
'with information resulted fill an listView
end sub

end class

3)public class Level3
inherits Level2

'nothing
end class

If is needed I can make a small project and attached. thanks

ctescu  Tuesday, February 07, 2006 12:50 PM
You forgot to paste the error message... (no additional code in the constructors?)
Jelle van der Beek2  Tuesday, February 07, 2006 2:24 PM
Is no aditional cod in constructor, and the problem, the bug is that the .Net not respond at anything, (task manager) - not responding, and the computer that I test have processor of 1,7GHz and 1Gb RAM.
ctescu  Tuesday, February 07, 2006 2:31 PM

You can use google to search for other answers

Custom Search

More Threads

• Dynamically set the size of ListView
• Crystal Reports
• Same context menu in multiple ListView
• Label character spacing runtime/designtime
• Where should I put the global variables?
• Synchronization primitives, exitContext and AsyncOperation
• How to add multiple controls onto a Datagridview cell?
• How can I set focus column on DataGridView
• Run WinForms Process From Windows Service
• Accessing a listview like control in another application using C#