|
I think you can save it in a collection like : List<printpageeventargs>
Put that list as member variable.
|
|
|
|
|
How do you mean ???
How can It work's
|
|
|
|
|
hi all,
my question is regarding functional overloading.....
i know how functional overloading works.... but i would like to know wen all are we using functional overloading ie we use fn overloading wen we have multiple functions with same name......but my question is
why do we have to:
1)have multiple functions with same name......
2)can you give me very very simple code with some real life scenorio which will explain these to me......
also a simple explanation for delegates will also be appreciated both in cosole and windows form.......
thanking you in advance,
j
-- modified at 2:45 Tuesday 16th October, 2007
|
|
|
|
|
If you search on google using keywords ‘function overloading+c#’ or ‘delegates+c#’ you will get enough links to tutorials and samples.
If you face any specific problem while doing function overloading or while using delegates, let us know.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
thank you Dave
j
|
|
|
|
|
Hi everyone.
I'm testing something and I ran into a problem..at least it's a problem for me. I've dragged and dropped the dataset object into a form (or project). I have an existing xml XSD. this schema is quite large and contains also relationships those I can see in visual studio as small diamond elements connected with lines to related tables.
i do this:
dsDataset.ReadXMLSchema("blabla.xsd");
and what I'd like to do, is to get the names of the relationships.. but it seems quite impossible, as dsDataset.Relations is not giving me any of those relations defined by <xsd:keyref>. How can I access these ?
thanks you in advance.
- Michal
|
|
|
|
|
hi, i was wondering....how do you determine when to use sockets in networking. What conditions or requirement that needs sockets. the socket is from "using system.net.socket"
Thanks in advance
|
|
|
|
|
Hi,
Sockets are used when you want to exchange data between several applications using TCP/IP or UDP protocol. Try this [^] article.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
I development a project which has component at:
http://www.soft4science.com
I downloaded but i hav'nt got licence.
Please send me if:
+ You crack it.
+ You have license.
any people which same me. Pls Discuss with me.
-----------------------
thanks & best reguards.
Tuongnd80@yahoo.com
tuongnd
|
|
|
|
|
?????
Just buy the license. Only 299USD.
http://www.soft4science.com/products/MathMLControl/s4s_Order_MathMLControl.html
|
|
|
|
|
can somebody explain to me in C#
1>what are the different ways to call a function in C#?
2>how to declare a function with parameters?
3>how to call a function with parameters?
4>MOST IMP:how to return a value form a function?
its urgent.please explain in very simple terms
thanking you in advance
j
j
|
|
|
|
|
Your Ans~
Trustapple wrote: 1>what are the different ways to call a function in C#?
Just Write the function name from where you want to call with proper argumnet. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6).
You can invoke a function using Deligation also.
Trustapple wrote: 2>how to declare a function with parameters?
int Add(int a,int b)
void AddString(Sring s1,string s2)
Trustapple wrote: 3>how to call a function with parameters?
That i already explain
Trustapple wrote: 4>MOST IMP:how to return a value form a function?
just Simply use return statement
int Add(int a,int b)
{
int c=a+b;
return c;
}
Happy Programming
-----
Abhijit
|
|
|
|
|
Awesome....Thanks a lot.
but i have a small doubt
"Just Write the function name from where you want to call with proper argument. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6)."
i didnt understand this
now one more issue:
i wrote a code with two classes....
even with out linking the classes i am getting the correct output????
can you look into this and guide me where i am going wrong please......
class Program
{
int x;
int y;
int result;
char oper;
public int Add(int x, int y)
{
result = x + y;
return result;
}
public void display()
{
Console.WriteLine("{0}", result);
}
thanks again
class jiju
{
static void Main()
{
Program obj = new Program();
obj.Add(10, 20);
obj.display();
Console.ReadLine();
}
}
}
j
|
|
|
|
|
Trustapple wrote: Just Write the function name from where you want to call with proper argument. suppose , Add(int a,int b) is a function you just call it by
Add(5,6), if its return some value then s=Add(5,6)."
i didnt understand this
I just want to mean that if you have a function Add(int a ,int b) , u can call it by using Add(5,6)
that is
Void Add(int a,int b)
{
int c=a+b;
Console.Writeline(c.ToString());
}
Here no return , so u have to call it by Add(value1,value2)
and if the defination is like this , that its return the value
int Add(int a,int b)
{
return a+b;
}
Then u have to call it using result=Add(5,6);
Hope now it clear to u....
And ur code is correct.... what is the problem r u facing with it !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Your code works, but there are several things you can change here.
class Program
{
public int Add(int x, int y)
{
int result = x + y;
return result;
}
public void display(int result)
{
Console.WriteLine("{0}", result);
}
}
class jiju
{
static void Main()
{
Program obj = new Program();
int result = obj.Add(10, 20);
obj.display(result);
Console.ReadLine();
}
}
or
class Program
{
public int Add(int x, int y)
{
int result = x + y;
return result;
}
}
class jiju
{
static void Main()
{
Program obj = new Program();
int result = obj.Add(10, 20);
Console.WriteLine("{0}",result);
Console.ReadLine();
}
}
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
hi Andrei and abhijit,
thanks for the help.....
but what is confusing here is
in my code i have two classes and i didnot link the two classess......
but still i am getting the result ie my function is in parent class....
but i am calling it from the child class.....
but i didnot link the two classess
so how is it working..... ?
can you guys help me here????
thanks again
j
|
|
|
|
|
Jiju class is an inner class to Program in your example. Take a look at this [^] code. It is self explanatory of how inner classes work. You read also this [^]CodeProject article for more details.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
thankyou Andrei
one more doubt while i saw a code regarding functional overloading like this.....
class Program
{
int a;
int b;
int c;
public Program()
{
}
public Program(int x, int y)
{
a = x;
b = y;
}
public Program(int x, int y, int z)
{
a = x;
b = y;
c = z;
}
public oops jiju(int x,int y )
{
a=x;
b=y;
}
public void oops(int x, int y, int z)
{
a = x;
b = y;
c = z;
}
my doubts are here: public Program(int x, int y)
{
a = x;
b = y;
}
what is the purpose of a,b in this code......
i am a beginner with out null programming backing thats why i have so many questions ...sorry for the trouble
thanks again
jiju
j
|
|
|
|
|
Trustapple wrote: i am a beginner with out null programming backing thats why i have so many questions
First of all, if you are so new to programming start reading about OOP (Object Oriented Programming)
Trustapple wrote: my doubts are here: public Program(int x, int y)
{
a = x;
b = y;
}
what is the purpose of a,b in this code......
As you may have noticed, the "function" Program has it's name the same as the class...that means it's a constructor. In your example you have 3 constructors. One with no parameters
public Program()
{
...
}
One with 2 parameters
public Program(int x, int y)
{
...
}
And one with 3 parameters. In the last 2 constructor you store the values received as parameters into local variables. When you have 3 constructors you can create an object of Program type like this
Program obj = new Program();
Program obj1 = new Program(1,2);
Program obj2 = new Program(1,2,3);
For more details about overloading constructors...try Google.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hi All,
I am writting a C# project in which am using Browser Control. The object of this project to read values of JavaScript's variables values on the current page ,and add those values to ListBox control. Can anybody show me how to do this. Please help if you can I need to do this ASAP for my job.
Thanks,
Asif
A.Asif
|
|
|
|
|
Hi...
A.Asif wrote: to read values of JavaScript's variables
directly you will not be able to read the values of javascript variables, but to get values the possible solution is to create hidden fields in you application and store the values of the javascript variables into these hidden fields and finally in your code access those hidden fields and add the values into listbox control.
Regards,
Sandeep Kumar.V
|
|
|
|
|
Thanks for your help! I do understand hidden field part, however, I am not good with JavaScript, Can you please tell me how to get values into these fields from javascript.
Thanks,
Asif.
|
|
|
|
|
here is the example....
<html><br />
<head><br />
<script language="javascript"><br />
function fun1()<br />
{<br />
var testvariable="testdata";<br />
document.forms[0].hid1.value = testvariable;<br />
}<br />
</script><br />
</head><br />
<body><br />
<form><br />
<input type="hidden" name="hid1" id="hid1"><br />
<input type="button" Name="but1" id="but1" onclick="fun1()><br />
</form><br />
</body><br />
</html>
Regards,
Sandeep Kumar.V
|
|
|
|
|
|
hi all.
I have a service with multi threads and i want to debug a specified thread but not have to wait the others. I'm a new newbie. Please help me with this problem. I've spent much time with it but get no result.
Many Thanks!
|
|
|
|