0

examples:

  1. picturebox1.backcolor = colordialog1.color

  2. picturebox1.load(openfiledialog1.filename)

question: Why does number one use a = sign and number two use parenthesis to use the dialog result?

1 Answers1

2

Number one is a property and number two a method.

Difference

  • A property normally just gets/sets a private field in a class and should not have side-effects or be an expensive operation.
  • A method in a class can be a procedure that performs some sort of operation on the data within the class.
Community
  • 1
  • 1
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939