Click here to Skip to main content
15,887,363 members
Home / Discussions / C#
   

C#

 
GeneralRe: source code Pin
Pete O'Hanlon16-Feb-11 22:32
mvePete O'Hanlon16-Feb-11 22:32 
GeneralRe: source code Pin
fjdiewornncalwe25-Feb-11 10:49
professionalfjdiewornncalwe25-Feb-11 10:49 
GeneralRe: source code Pin
Alan Balkany17-Feb-11 9:52
Alan Balkany17-Feb-11 9:52 
GeneralRe: source code Pin
om_metab17-Feb-11 12:32
om_metab17-Feb-11 12:32 
GeneralRe: source code PinPopular
Not Active16-Feb-11 14:47
mentorNot Active16-Feb-11 14:47 
GeneralRe: source code Pin
om_metab17-Feb-11 12:36
om_metab17-Feb-11 12:36 
GeneralRe: source code Pin
Not Active17-Feb-11 13:27
mentorNot Active17-Feb-11 13:27 
Questionabstract, override and the Visual Studio Designer Pin
Dewald15-Feb-11 21:52
Dewald15-Feb-11 21:52 
Hi all,

As a part of my project I have an abstract class that looks like this:
abstract class TabPageTemplate : TabPage
    {
        public abstract void Process();
        public abstract void Cancel();
        public abstract bool LoseFocus();
        public abstract void Populate(int identifier);
        public abstract event EventHandler PageClosed;
    }


I also have separate classes defined, all of which implement the above abstract class. On another Form (that contains a TabControl) I can then add any of these TabPages and know that each one will have implemented the four methods and one event handler so I can call any of them.

It works great, but there is one major inconvenience. I have to design the layout of all of those TabPages in code, I cannot use the VS Designer. The reason for this is that the Designer can't create an instance of whatever TabPage I'm busy designing (because the base class from which the TabPage inherits is abstract). This is the error message that the Designer gives me:
The designer must create an instance of type 'MyProject.TabPageTemplate' but it cannot because the type is declared as abstract.

Would anyone have some advice for me here? At first this wasn't a problem but these TabPages are getting quite complex now and doing all of the control layout in code is getting very tedious.
AnswerRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 0:47
sitebuilderLuc Pattyn16-Feb-11 0:47 
JokeRe: abstract, override and the Visual Studio Designer Pin
Wayne Gaylard16-Feb-11 1:17
professionalWayne Gaylard16-Feb-11 1:17 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 1:57
sitebuilderLuc Pattyn16-Feb-11 1:57 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 1:56
Dewald16-Feb-11 1:56 
AnswerRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 2:04
sitebuilderLuc Pattyn16-Feb-11 2:04 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 2:37
Dewald16-Feb-11 2:37 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 2:51
sitebuilderLuc Pattyn16-Feb-11 2:51 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 4:05
Dewald16-Feb-11 4:05 
AnswerRe: abstract, override and the Visual Studio Designer Pin
PIEBALDconsult16-Feb-11 1:48
mvePIEBALDconsult16-Feb-11 1:48 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 2:02
Dewald16-Feb-11 2:02 
QuestionWrite contents of dataset into email Pin
<<Tash18>>15-Feb-11 18:56
<<Tash18>>15-Feb-11 18:56 
AnswerRe: Write contents of dataset into email Pin
Hum Dum15-Feb-11 20:07
Hum Dum15-Feb-11 20:07 
GeneralRe: Write contents of dataset into email Pin
<<Tash18>>15-Feb-11 20:13
<<Tash18>>15-Feb-11 20:13 
GeneralRe: Write contents of dataset into email Pin
Hum Dum15-Feb-11 20:15
Hum Dum15-Feb-11 20:15 
GeneralRe: Write contents of dataset into email Pin
<<Tash18>>15-Feb-11 20:27
<<Tash18>>15-Feb-11 20:27 
GeneralRe: Write contents of dataset into email Pin
<<Tash18>>15-Feb-11 21:39
<<Tash18>>15-Feb-11 21:39 
GeneralRe: Write contents of dataset into email Pin
Hum Dum15-Feb-11 21:55
Hum Dum15-Feb-11 21:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.