|
-
Apr 28th, 2005, 07:02 AM
#1
Thread Starter
Addicted Member
[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
-
Apr 28th, 2005, 07:51 AM
#2
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)
-
Apr 29th, 2005, 12:22 AM
#3
Thread Starter
Addicted Member
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
-
Apr 29th, 2005, 03:38 AM
#4
Re: global Function Generate Erroe
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|