Click here to Skip to main content
16,012,821 members
Home / Discussions / C#
   

C#

 
GeneralRe: datatable in class, XMLserialization Pin
Member 114126619-Jun-04 23:22
Member 114126619-Jun-04 23:22 
GeneralRe: datatable in class, XMLserialization Pin
Heath Stewart20-Jun-04 9:57
protectorHeath Stewart20-Jun-04 9:57 
QuestionCalling the default ctor from an overloaded ctor? Pin
matthias s.19-Jun-04 3:38
matthias s.19-Jun-04 3:38 
AnswerRe: Calling the default ctor from an overloaded ctor? Pin
leppie19-Jun-04 4:20
leppie19-Jun-04 4:20 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
matthias s.19-Jun-04 5:12
matthias s.19-Jun-04 5:12 
AnswerRe: Calling the default ctor from an overloaded ctor? Pin
Nick Parker19-Jun-04 4:32
protectorNick Parker19-Jun-04 4:32 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
matthias s.19-Jun-04 5:14
matthias s.19-Jun-04 5:14 
AnswerRe: Calling the default ctor from an overloaded ctor? Pin
Colin Angus Mackay19-Jun-04 4:41
Colin Angus Mackay19-Jun-04 4:41 
The way I've always done this kind of thing is to create an initialise method and call that. So your code would look like:
public class MainForm : System.Windows.Forms.Form 
{
    public MainForm() 
    {
        InitialiseCommon();
    }

    public MainForm(string Somestring) 
    {
        mSomestring = Somestring;
        InitialiseCommon();
    }

    private void InitialiseCommon()
    {
        InitializeComponent();
        PrepareSomeStuff();
        SomeMoreStuff();        
    }
    // privates omitted...
}


At least this was the way I was taught to do it in my C++ lectures years and years ago when I was at university. I've just updated the idea for C# and it works nicely.


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

The Second EuroCPian Event will be in Brussels on the 4th of September

Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

My Blog


GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Nick Parker19-Jun-04 4:47
protectorNick Parker19-Jun-04 4:47 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Colin Angus Mackay19-Jun-04 5:07
Colin Angus Mackay19-Jun-04 5:07 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Nick Parker19-Jun-04 5:37
protectorNick Parker19-Jun-04 5:37 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
matthias s.19-Jun-04 5:10
matthias s.19-Jun-04 5:10 
GeneralRe: Calling the default ctor from an overloaded ctor? Pin
Heath Stewart19-Jun-04 7:19
protectorHeath Stewart19-Jun-04 7:19 
GeneralTwo RTF Questions Pin
XanderSon19-Jun-04 3:18
XanderSon19-Jun-04 3:18 
GeneralRe: Two RTF Questions Pin
Heath Stewart19-Jun-04 7:14
protectorHeath Stewart19-Jun-04 7:14 
GeneralRe: Two RTF Questions Pin
XanderSon19-Jun-04 13:51
XanderSon19-Jun-04 13:51 
QuestionHow to use MFC dll in C#? Pin
ting66819-Jun-04 3:14
ting66819-Jun-04 3:14 
AnswerRe: How to use MFC dll in C#? Pin
Heath Stewart19-Jun-04 6:43
protectorHeath Stewart19-Jun-04 6:43 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 2:00
ting66820-Jun-04 2:00 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 11:54
protectorHeath Stewart20-Jun-04 11:54 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 15:45
ting66820-Jun-04 15:45 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 17:48
protectorHeath Stewart20-Jun-04 17:48 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart20-Jun-04 11:54
protectorHeath Stewart20-Jun-04 11:54 
GeneralRe: How to use MFC dll in C#? Pin
ting66820-Jun-04 21:32
ting66820-Jun-04 21:32 
GeneralRe: How to use MFC dll in C#? Pin
Heath Stewart21-Jun-04 2:08
protectorHeath Stewart21-Jun-04 2:08 

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.