Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 719
  • Last Modified:

FormStack code -- Urgent Help

Hi experts,

I need urgent help regarding FormStack example i have downloaded from msdn.
If somebody has used it, please help me.

In this example,
for my forms to be able to pushed and popped, i need to derive them from StackForm class.

But after doing that i am not able to see my form in Designer. Because that form is an abstract Class, it is showing the error.


Any help will be appreciated.
Thanks.
0
chintan_vaishya
Asked:
chintan_vaishya
  • 4
  • 3
1 Solution
 
123654789987Commented:
0
 
123654789987Commented:
0
 
chintan_vaishyaAuthor Commented:
Hey man,

None of the links u gave contains any information about what i want.

If you have some info, please give the right link.

Thanks for your reply.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
123654789987Commented:
I checked the sample from the following site

http://www.microsoft.com/downloads/details.aspx?FamilyId=06D345C8-18C5-4FBA-A25E-D44286D6F2A3&displaylang=en

I think the code project sample that I gave is exactly what u want as he has used the FormStac sample from MSDN

0
 
chintan_vaishyaAuthor Commented:
Hi,

I dont think he has use the FormStack sample from MSDN. He has no where used any class also from the FormStack example, he has just written that, he has taken some idea from this example.

Thanks.
0
 
CeiledCommented:
As you've already noticed, you can't design a class that derives directly from an abstract class, so you have two basic options:

1. If you have the source code for the sample (I haven't looked at it), just change the StackForm class so it isn't abstract.
2. Otherwise, simply create a new, non-abstract class that inherits directly from StackForm and implements any abstract methods provided by StackForm by throwing NotImplementedExceptions, then inherit your forms from that. Classes derived from a class that derives from an abstract class are perfectly designable.

If you're interested, the reason you can't design classes that are derived from abstract classes is for the simple reason that the object actually displayed on the design surface is actually an instance of the base class, not the derived class, and you obviously can't instantiate an abstract class. Visual Studio instantiates the base class, then parses your InitializeComponent() method to apply any changes to it that are described in that function. This is also why, if you define a property on a class and then bring that class up in the designer, you won't be able to set the new property in the property grid. Hope this helps.
0
 
chintan_vaishyaAuthor Commented:
Hi Ceiled,

I have the source code, i removed the abstract from class definitions and changed the abstract methods to be virtual methods, which i m overriding in other classes.
Now, after removing abstract from the class which is my base class and from which i m deriving this class which i want to see in designer. The designer is giving me these errors. Still it is not showing me the form in designer.

One thing i would like to tell you is that i m overriding the InitializeComponent method in all the forms i derive. and the base class is having a virtual method InitializeComponent.

1) Error reading resources from the resource file for the default culture: Invalid ResX input.  Could not find valid "resheader" tags for the ResX reader & writer type names.

2)  Member not found. (As many number of controls are there)

3)  Object type cannot be converted to target type.

I think you can help me out in this, thanks in advance for your help.
0
 
chintan_vaishyaAuthor Commented:
Hi Ceiled,

I got to know from somewhere that,
designer doesn't support visual inheritance, so you cannot expect to be able to view your new class in the designer.

Could you give me suggestion how do i solve the problem ??

As my base class is derived from System.Windows.Forms.Form...........and my derived class is derived from base class and i am not able to see my derived class form in designer. (may be because visula inheritance is not supported in designer)

Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now