?
Solved

FormStack code -- Urgent Help

Posted on 2004-09-16
8
Medium Priority
?
712 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

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

Independent Software Vendors: 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!

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

800 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