Solved

FormStack code -- Urgent Help

Posted on 2004-09-16
8
692 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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