开发者

Problems with visual inheritance, Visual Studio 2008 C#

开发者 https://www.devze.com 2023-03-01 14:23 出处:网络
I have this problem with Visual Studio 2008 C#. There\'s a base form and a number of Windows forms that inherit from it. (Yes, I think I\'ve compiled the base form before I tried to inherit from it.)

I have this problem with Visual Studio 2008 C#. There's a base form and a number of Windows forms that inherit from it. (Yes, I think I've compiled the base form before I tried to inherit from it.)

The derived forms compile smoothly, without errors, but they display only what they inherited from the base form. In other words, all derived forms look and behave exactly like the base form at run time, even though they are different at design time--they have many controls not found on the base form.

Has anyone ever had this problem b开发者_开发技巧efore, and how was it solved?


The issue was resolved by specifying which form appears first at runtime. This was done by naming the form in Program.cs, as follows:

Application.Run(new DerivedForm());

Previously, the name of the base form appeared in the parentheses above.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号