1

Sample scenario and my first stupid question on this network.

I have winform as dll. It's contain reusable method and properties.

Code:

using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MyWinForm 
{
    public partial class MyWinForm : Form
    {        

    public string SetName{
        get;set;
    }
        public MyWinForm()
        {
            InitializeComponent();
        }

    }
}

Then I used this Form (MyWinForm) by removing default Form Inheritance code to get SetName property for all Windows Forms in My Project.Otherwise I should write that property for all forms in my application.

Code

using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FormLogin
{
    public partial class FormLogin: MyWinForm
    { 

        public FormLogin()
        {
            InitializeComponent();
        }

    }
}

Then I can use SetName property in my every and each form by deriving MyWinForm.

After That I need to add Method Such as Save() ,Edit() & Delete() to that my custom MyWinForm class to user force to implement that methods.How to implement such method with MyWinForm class? What concept I use for that?

Objective : When Inherit MyWinForm into Other Forms Then Compiler suggest to add That methods into That newly created form.I try to implement Interface,When It's deriving MyWinForm that interface method only add in inherited form(MyWinForm).After I inherit MyWinForm into Another Form it's not force to implement that methods.I need do that type of things.Because I already Inherited MyWinForm to other Windows Forms.Only I can do change MyWinForm.

Edit C# Auto implemented functions or by force to user implement the functions

I have custom Winform call MyWinForm.It's Then it's Inherits Like this.

public partial class FormEployee: MyWinForm

Then I am cording with FormEployee it's calling from MDI Form call mainForm menu. MDI form have four(4) Buttons to call Save(),Edit(),Delete() and Print()

It's calling like this.

Ex: Save Button calling in MDI form.Under the save button event I wrote this.

 Form activeForm = this.ActiveMdiChild;

After that I need to calling something like this.

activeForm.Save(); 

I need declare this Save() function in MyParent form.because every active form have save function and it's calling form MDI Parent form.So that function name cannot change.Several developers on this project so I need to have to by force to implement function name same in forms.But method body can change.What type of concept I used to achieve this type of thing? I try to use C# Interface and it's implement my MyWinForm.But it's not work.

closed as unclear what you're asking by Telastyn, Ben Aaronson, Arseni Mourzenko, durron597, user40980 Jul 10 '15 at 0:04

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    I get English may not be your first language but this is not clear to me. Are you looking for Abstract? – paparazzo Jul 8 '15 at 12:27
  • 3
    I can understand ur context but please specify your question more clearly! – codeninja.sj Jul 8 '15 at 12:53

Browse other questions tagged or ask your own question.