Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
Questionweb service???? Pin
don7cry10-Aug-03 23:28
don7cry10-Aug-03 23:28 
AnswerRe: web service???? Pin
Anthony_Yio11-Aug-03 1:59
Anthony_Yio11-Aug-03 1:59 
Generalinsert statement for ms access Pin
zecodela10-Aug-03 23:01
zecodela10-Aug-03 23:01 
GeneralRe: insert statement for ms access Pin
Nish Nishant10-Aug-03 23:12
sitebuilderNish Nishant10-Aug-03 23:12 
GeneralWhich button was pressed... Pin
eggie510-Aug-03 21:29
eggie510-Aug-03 21:29 
GeneralRe: Which button was pressed... Pin
Meysam Mahfouzi10-Aug-03 22:25
Meysam Mahfouzi10-Aug-03 22:25 
GeneralRe: Which button was pressed... Pin
eggie511-Aug-03 0:20
eggie511-Aug-03 0:20 
GeneralRe: Which button was pressed... Pin
Heath Stewart11-Aug-03 2:48
protectorHeath Stewart11-Aug-03 2:48 
Have you ever programmed before? You can declare a variable of any type you want. This is evident in every programming language. You can use generics or types for variables, fields, properties, function parameters, and whatever you choose.

Some languages like JavaScript/JScript may declare a variable type as var (a generic), but even it has a type - the type of whatever function or object filled it (like var d = new Date(); - d is now of type Date)

Similarily, the same is true in .NET (and Java and MFC). Every class in those frameworks (and some others) derives from Object (or CObject, etc.) If you assign a different type to a generic variable, the type is still that of the type you assigned it:
object o = new Button();

o is actually of type Button, even though it is declared as an Object. You could also declare that variable as a Button, or a Control, or any base class of the Button type. Casting that object doesn't change it - merely gives you access to the methods and properties defined for that class (or inherited by base classes). For example, it wouldn't matter if the variable was declared as a Object or a Button. If you called the ToString method, the method that is called is the one declared on Button because it overrided the method of a base class. This is typically (shall I say, "standard") object-oriented programming (OOP).

I recommend you pick up a good book on .NET programming, or even just OO programming. Looking at a lot of the questions that you've posted, you should also browse around the base class library (BCL) documentation that was installed with the .NET Framework SDK and Visual Studio .NET.

This isn't a slam, but a reminder that research is only half (if not more) of development. Guessing and getting other people to do the work is not going to teach you anything. Browsing around the .NET Framework library will at least familiarize you with what is available so you have some idea of what you could use in a given problem so you don't have to reinvent the wheel. A good book on OO will help you design efficient and effective code.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Which button was pressed... Pin
eggie511-Aug-03 10:31
eggie511-Aug-03 10:31 
GeneralRe: Which button was pressed... Pin
Csharp™11-Aug-03 0:01
Csharp™11-Aug-03 0:01 
GeneralRe: Which button was pressed... Pin
Csharp™11-Aug-03 0:57
Csharp™11-Aug-03 0:57 
GeneralRe: Which button was pressed... Pin
eggie511-Aug-03 10:31
eggie511-Aug-03 10:31 
Generalreading serialized java Hashtable Pin
misterbear10-Aug-03 21:07
misterbear10-Aug-03 21:07 
GeneralRe: reading serialized java Hashtable Pin
Frank Olorin Rizzi11-Aug-03 1:42
Frank Olorin Rizzi11-Aug-03 1:42 
GeneralRe: reading serialized java Hashtable Pin
Heath Stewart11-Aug-03 2:34
protectorHeath Stewart11-Aug-03 2:34 
GeneralRe: reading serialized java Hashtable Pin
misterbear11-Aug-03 4:22
misterbear11-Aug-03 4:22 
GeneralGetting all of the items in a list box.. Pin
eggie510-Aug-03 18:29
eggie510-Aug-03 18:29 
GeneralRe: Getting all of the items in a list box.. Pin
Meysam Mahfouzi10-Aug-03 21:12
Meysam Mahfouzi10-Aug-03 21:12 
GeneralRe: Getting all of the items in a list box.. Pin
eggie511-Aug-03 0:21
eggie511-Aug-03 0:21 
GeneralDynamic TextBoxes Pin
deanoA10-Aug-03 16:27
deanoA10-Aug-03 16:27 
GeneralRe: Dynamic TextBoxes Pin
Nick Seng10-Aug-03 17:42
Nick Seng10-Aug-03 17:42 
QuestionCan I make this? Pin
deanoA10-Aug-03 16:02
deanoA10-Aug-03 16:02 
AnswerRe: Can I make this? Pin
Nish Nishant10-Aug-03 16:13
sitebuilderNish Nishant10-Aug-03 16:13 
GeneralRe: Can I make this? Pin
deanoA10-Aug-03 16:25
deanoA10-Aug-03 16:25 
GeneralRe: Can I make this? Pin
Nish Nishant10-Aug-03 17:50
sitebuilderNish Nishant10-Aug-03 17:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.