|
Well - all classes ultimately inherit from object .
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey Chris/Pete
I think we all are missing my queries
a) What is default type (ByVal/ByRef) in C# and Vb.Net?
b) Which is a good practice if passing values to different components when they are on same machine and as well as on different machines.....
Thanks
Thanks
|
|
|
|
|
a) ByVal/ByRef are not types, they are keywords in VB.NET (and ref is in C#)
b) best practice is to use what you need; i.e. use ByRef if the callee must be able to
change the value/object as seen by caller, use ByVal otherwise.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I think you might need to go back to basics and read up on the fundimentals of .Net.
You can have two different types of type, one is reference types, the other is value types.
By default reference types are passed by reference and value types are passed by value.
Classes are reference types and structs/primatives are value types.
If you don't understand any of this buy any beginner .Net book and it'll be in the first few chapters
As for best practice ... use what is needed.
|
|
|
|
|
Ahh - I think I see what you are getting at. .NET differs from VB (6) in that it passes parameters by value and not by reference.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Suppose ...
public interface IMyInterface{<br />
void MyMethod();<br />
}<br />
<br />
public class ClassA:IMyInterface{<br />
public void MyMethod(){}<br />
}<br />
<br />
public class ClassB:ClassA,IMyInterface{<br />
public void MyMethod(){}<br />
}<br />
Can anyone tell me if it's required to specify that ClassB inherits IMyInterface ?
The interface is to my opinion inherited through the base class ClassA, but it seems
specifying (or not) the interface inheritance in the derived class ClassB makes no
difference.
|
|
|
|
|
You dont need to unless u want to 'override' the behaviour. This normally means you have designed something wrong
To override the interface implementation, you would likely have to use an explicit implementation.
|
|
|
|
|
Indeed I want to override (reimplement) the interface behaviour in the derived ClassB,
but my question really is wether to use ...
public class ClassB:ClassA,IMyInterface
or
public class ClassB:ClassA
as the ClassB declaration ?
Both work for me, but I was wondering if there's a difference
(behind the scenes ?) for either one of them !
|
|
|
|
|
hi all
how i can to calculate the width of the text
i means of width of text is not the number of char in text
i mean the width of this text the width for each of text
Thaer
|
|
|
|
|
The System.Drawing.Graphics object has a MeasureString method
|
|
|
|
|
hi
in a form or control do this:
using(Graphics g = this.CreateGraphics())
{
SizeF textSize = g.MeasureString("mytext", Font);
}
regards
|
|
|
|
|
when user press F12, my prg will open a new form showing screen shot.
how could i code?
i used keypreview, keyup event.
it works just if the main window is activated, or not it doesnt work.
is there any easy way without writing a win. service.?
|
|
|
|
|
No. I'm not even sure a service will do it, you need a system wide keyboard hook
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Please suggest any way that enables me to CAB and UNCAB files via c# application...
|
|
|
|
|
Please don't repost questions so quickly - it's quite rude. People here give their time freely, and will get to you when they can. So please, be patient.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
I assume it's either the impatience of youth, or he forgot to put Urgent. Plz Help... in the post.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have replied him in his original thread itself. There was a direct CP article that was befitting his requirement.
|
|
|
|
|
I like to know how to keep track of person logged on to the system after postback of a page!.Or to carry information of a person logged on to the system through different pages.
|
|
|
|
|
one method is to use the session
Session.Add("username",myuser);
darkhero
|
|
|
|
|
I want my application main form to contain a lot of forms that will be open by the user (press on button's).
I want some main form that will by fill the container of the form .
My container is MdiParent but my problem is that if the user drag the form out of the border the container is expand.
how can i block the continer to be at the size of the visual state ?
Shai Sherman
|
|
|
|
|
|
Please don't repost so quickly. It's generally considered to be quite rude.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You've been told once already: Do your own homework?
We are willing to help if you show what you have tried to do and then we can help to show you where you went wrong and how to fix it. However, you have not shown any attempt at the problem that you are having difficulty with yet.
|
|
|
|
|
That code does not represent the problem. For a start your problem statment requires TWO inputs. Where is the other one?
|
|
|
|