Results 1 to 4 of 4

Thread: [RESOLVED] global Function Generate Erroe

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    141

    Resolved [RESOLVED] global Function Generate Erroe

    It s global method
    We pass Form object in this function when we compile Programmer system generate error message
    'System.Windows.Forms.Form' does not contain a definition for 'SaveValues'

    SaveValues() and ClearValues exist in all forms we want we just pass Form Object in Function

    private void button1_Click(object sender, System.EventArgs e)
    {
    Form1 f1 = new Form1();
    DentMode(f1);

    }

    public string DentMode(System.Windows.Forms.Form frmName)
    {
    frmName.SaveValues();
    SecondName.ClearValues();
    }
    Last edited by Waseemalisyed; May 10th, 2005 at 06:39 AM. Reason: ok

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: global Function Generate Erroe

    SaveValues may exist in all the forms you create but is does not exist in the standard .NET Windows.Form which is what you are passing as an argument in your DentMode method.

    What you need to do is create your own form (eg myForm) which inherits the standard form add your SaveValues method to it.
    Then declare all forms as myForm and then
    DentMode(myForm frmName)
    instead of
    DentMode(Form frmName)

    Edit:
    or
    public string DentMode(System.Windows.Forms.Form frmName)
    to
    public string DentMode(Form1 frmName)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    141

    Angry Re: global Function Generate Erroe

    Savevalues,EditValues,DeleteValues function exist in all standard .NET Windows.Form
    DentMode function exist in Standard Module /Global Class/General Class
    frmName is Form type Parameter

    public string DentMode(System.Windows.Forms.Form frmName,Mode)
    if (Mode == "A")
    {
    frmName.SaveValues();
    }
    else if (Mode =="E")
    {
    frmName.EditValues();
    }
    else if (Mode =="D")
    {
    frmName.DeleteValues();
    }

    required is:
    when User enter Standard Windows Form object and Mode in DentMode Function Parameter system check if mode = "A" then execute Passing form SaveValues Function

  4. #4
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: global Function Generate Erroe

    Quote Originally Posted by Waseemalisyed
    Savevalues,EditValues,DeleteValues function exist in all standard .NET Windows.Form
    No they don't.
    Form Browser Show me where they exist.

    Do you know the difference between:
    Form1 frmName;
    and
    Form frmName;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width