Solved

FormStack code -- Urgent Help

Posted on 2004-09-16
8
687 Views
Last Modified: 2012-06-27
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
Comment
Question by:chintan_vaishya
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:123654789987
ID: 12072787
0
 
LVL 10

Expert Comment

by:123654789987
ID: 12072803
0
 
LVL 3

Author Comment

by:chintan_vaishya
ID: 12072847
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
 
LVL 10

Expert Comment

by:123654789987
ID: 12072917
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Author Comment

by:chintan_vaishya
ID: 12082153
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
 
LVL 7

Accepted Solution

by:
Ceiled earned 500 total points
ID: 12096051
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
 
LVL 3

Author Comment

by:chintan_vaishya
ID: 12099632
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
 
LVL 3

Author Comment

by:chintan_vaishya
ID: 12099711
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now