Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FormStack code -- Urgent Help

Posted on 2004-09-16
8
Medium Priority
?
716 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
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.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 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