Click here to Skip to main content
16,004,969 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: yes/no Pin
Christian Graus17-Jun-07 10:21
protectorChristian Graus17-Jun-07 10:21 
QuestionForm with an abstract base class? Pin
Jon Hulatt13-Jun-07 0:49
Jon Hulatt13-Jun-07 0:49 
AnswerRe: Form with an abstract base class? Pin
Pete O'Hanlon13-Jun-07 2:31
mvePete O'Hanlon13-Jun-07 2:31 
GeneralRe: Form with an abstract base class? Pin
originSH18-Jun-07 23:46
originSH18-Jun-07 23:46 
GeneralRe: Form with an abstract base class? Pin
Colin Angus Mackay19-Jun-07 0:07
Colin Angus Mackay19-Jun-07 0:07 
GeneralRe: Form with an abstract base class? [modified] Pin
originSH19-Jun-07 0:31
originSH19-Jun-07 0:31 
AnswerRe: Form with an abstract base class? Pin
Dave Kreskowiak13-Jun-07 4:37
mveDave Kreskowiak13-Jun-07 4:37 
AnswerRe: Form with an abstract base class? Pin
Colin Angus Mackay13-Jun-07 13:20
Colin Angus Mackay13-Jun-07 13:20 
There is a way around it, but it is ugly and could cause you more problems in the long run. In fact, I don't recommend it at all.

Caveat out the way, here it is:

#if DEBUG
public class MyForm : Form
#else
public abstract MyForm : Form
#endif


Ugly, ain't it!

Normally you would be using the designer when your application was being built for debug. When you switch to release mode you lose the ability to use the designer, but it will still built. The main problem arises when you've forgotten that the class will really be abstract in the release build and you try and instantiate it and the release build fails.

Oh, and I think in VS2005 the MyForm.designer.cs file will keep losing the preprocessor stuff when you change things on the design surface - Fine for debug builds, but it will also cause the release build to fail.

If fact, I really really wouldn't recommend this course of action.


Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5

Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton


My website

JokeRe: Form with an abstract base class? Pin
MidwestLimey14-Jun-07 14:27
professionalMidwestLimey14-Jun-07 14:27 
GeneralRe: Form with an abstract base class? Pin
Colin Angus Mackay14-Jun-07 21:20
Colin Angus Mackay14-Jun-07 21:20 
GeneralRe: Form with an abstract base class? Pin
Colin Angus Mackay15-Jun-07 4:19
Colin Angus Mackay15-Jun-07 4:19 
QuestionExport data from UltrawinGrid to PDF Pin
Rahul8312-Jun-07 23:45
Rahul8312-Jun-07 23:45 
QuestionForm1 Larger Than Screen, TableLayoutPanel ??? Pin
Duane in Japan12-Jun-07 20:29
Duane in Japan12-Jun-07 20:29 
QuestionMake child controls follow scroll. Pin
Genbox12-Jun-07 10:46
Genbox12-Jun-07 10:46 
AnswerRe: Make child controls follow scroll. Pin
MatrixCoder12-Jun-07 11:22
MatrixCoder12-Jun-07 11:22 
GeneralRe: Make child controls follow scroll. Pin
Genbox12-Jun-07 11:27
Genbox12-Jun-07 11:27 
GeneralRe: Make child controls follow scroll. Pin
MatrixCoder12-Jun-07 13:12
MatrixCoder12-Jun-07 13:12 
GeneralRe: Make child controls follow scroll. Pin
Genbox12-Jun-07 21:22
Genbox12-Jun-07 21:22 
GeneralRe: Make child controls follow scroll. Pin
MatrixCoder13-Jun-07 9:11
MatrixCoder13-Jun-07 9:11 
GeneralRe: Make child controls follow scroll. Pin
Genbox13-Jun-07 11:04
Genbox13-Jun-07 11:04 
GeneralRe: Make child controls follow scroll. Pin
MatrixCoder13-Jun-07 13:06
MatrixCoder13-Jun-07 13:06 
QuestionPropertyGrid FolderNameEditor Pin
Rome Singh12-Jun-07 9:41
Rome Singh12-Jun-07 9:41 
AnswerRe: PropertyGrid FolderNameEditor Pin
visualhint15-Jun-07 8:01
visualhint15-Jun-07 8:01 
QuestionMonth Pin
tantoun12-Jun-07 5:07
tantoun12-Jun-07 5:07 
AnswerRe: Month Pin
PaulPrice12-Jun-07 5:28
PaulPrice12-Jun-07 5:28 

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.