Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralMouseWheel Event Pin
Anonymous16-Jun-05 0:41
Anonymous16-Jun-05 0:41 
GeneralRe: MouseWheel Event Pin
Marc Clifton16-Jun-05 1:23
mvaMarc Clifton16-Jun-05 1:23 
QuestionAdd-in, how to work with it? Pin
Khoa Bui15-Jun-05 23:28
Khoa Bui15-Jun-05 23:28 
AnswerRe: Add-in, how to work with it? Pin
Werdna16-Jun-05 4:55
Werdna16-Jun-05 4:55 
GeneralCrystal report and C# Pin
jeya_00715-Jun-05 23:16
jeya_00715-Jun-05 23:16 
QuestionListView - some kind of a scroll event? Pin
iliyang15-Jun-05 22:55
iliyang15-Jun-05 22:55 
Questionwhat is the difference between Property and Public Field? Pin
Khoa Bui15-Jun-05 22:51
Khoa Bui15-Jun-05 22:51 
AnswerRe: what is the difference between Property and Public Field? Pin
iliyang15-Jun-05 23:06
iliyang15-Jun-05 23:06 
Well, it is the one magical thing that grabbed me a few years ago
when I was reading a thin book about the C# language Wink | ;)

The public field is just a variable that you can read and write
without any control. I mean that you can set the field any value
that is possible for the type of the field. And that's pretty much
it.

While the property is a more complex thing - it appears to be a
public variable but it's a totally different thing. A property is a
set of one or two functions in fact (accessor and/or modificator).

For example, assume that we have the "public string Name" property.
When the compiler generates the IL code, it generates also
one or both of the following functions:

public string get_Name() { the_statements_in_the_get_function; }
public void set_Name(string value) { the_statements_in_the_set_function; }

And you can do anything inside. Getting the value of a property
calls the get_Name function, and setting a value to the property
calls the set_Name function. That's pretty powerful, 'cause you can
do many more things than return/set the actual variable beneath (if
there is one) - you can raise events, force redraw etc.

And of course, we should thank Delphi for this nice language feature Wink | ;)

Cheers!
AnswerRe: what is the difference between Property and Public Field? Pin
Andrew Kirillov15-Jun-05 23:12
Andrew Kirillov15-Jun-05 23:12 
Generalthanks, I got it! Pin
Khoa Bui15-Jun-05 23:25
Khoa Bui15-Jun-05 23:25 
GeneralRe: thanks, I got it! Pin
Colin Angus Mackay16-Jun-05 0:52
Colin Angus Mackay16-Jun-05 0:52 
GeneralRe: thanks, I got it! Pin
iliyang16-Jun-05 1:15
iliyang16-Jun-05 1:15 
AnswerRe: what is the difference between Property and Public Field? Pin
eggie516-Jun-05 5:39
eggie516-Jun-05 5:39 
Questionhow merge 2 PNG images in one Pin
Anonymous15-Jun-05 22:32
Anonymous15-Jun-05 22:32 
AnswerRe: how merge 2 PNG images in one Pin
Niklas Ulvinge15-Jun-05 22:57
Niklas Ulvinge15-Jun-05 22:57 
AnswerRe: how merge 2 PNG images in one Pin
iliyang15-Jun-05 23:13
iliyang15-Jun-05 23:13 
GeneralRe: how merge 2 PNG images in one Pin
Anonymous16-Jun-05 0:04
Anonymous16-Jun-05 0:04 
GeneralRe: how merge 2 PNG images in one Pin
iliyang16-Jun-05 0:38
iliyang16-Jun-05 0:38 
GeneralRe: how merge 2 PNG images in one Pin
Anonymous16-Jun-05 1:33
Anonymous16-Jun-05 1:33 
Generalunsafe code Pin
usbah15-Jun-05 22:05
usbah15-Jun-05 22:05 
GeneralRe: unsafe code Pin
Andrew Kirillov15-Jun-05 23:18
Andrew Kirillov15-Jun-05 23:18 
Generalerror Pin
fatidarya15-Jun-05 21:59
fatidarya15-Jun-05 21:59 
GeneralRe: error Pin
Dave Kreskowiak16-Jun-05 4:40
mveDave Kreskowiak16-Jun-05 4:40 
GeneralStart and use an external application Pin
Rey999915-Jun-05 21:53
Rey999915-Jun-05 21:53 
GeneralRe: Start and use an external application Pin
codeprojectin15-Jun-05 21:59
codeprojectin15-Jun-05 21:59 

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.