Click here to Skip to main content
15,920,801 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionList Box / Combo Box Pin
Riaz Ahmed31-Jul-08 3:55
Riaz Ahmed31-Jul-08 3:55 
AnswerRe: List Box / Combo Box Pin
Ajay.k_Singh31-Jul-08 4:37
Ajay.k_Singh31-Jul-08 4:37 
QuestionHow to find menu item visibility dynamically Pin
AR Reddy31-Jul-08 3:07
AR Reddy31-Jul-08 3:07 
AnswerRe: How to find menu item visibility dynamically Pin
Smithers-Jones31-Jul-08 3:32
Smithers-Jones31-Jul-08 3:32 
GeneralRe: How to find menu item visibility dynamically Pin
AR Reddy31-Jul-08 5:47
AR Reddy31-Jul-08 5:47 
GeneralRe: How to find menu item visibility dynamically Pin
AR Reddy1-Aug-08 0:41
AR Reddy1-Aug-08 0:41 
QuestionProperties verses Functions Pin
Steven J Jowett31-Jul-08 1:55
Steven J Jowett31-Jul-08 1:55 
AnswerRe: Properties verses Functions Pin
Gideon Engelberth31-Jul-08 3:42
Gideon Engelberth31-Jul-08 3:42 
Generally, properties are used to represent the state of an object and have few if any side effects when set, and functions are used to get something that will require a lot of calculation. FxCop will also tell you that you should never return an array from a property, but I do not always agree (especially for databinding).

There are no hard and fast rules, but there are a few things I would consider when making the choice. (I'm sure a quick Google search would find plenty of other opinions)

1) Will you both get and set the value? (if yes, +1 for property)
2) Will you only get the value? (could go either way)
3) Will you only set the value? (if yes, I would always make this a function. Write-only properties do not make much sense to me)
4) Are you going to need to databind to this value? (if yes, you will probably be required to make this a property)
5) Would the Get/Set functions be simple? (if yes, +2 for property)
Simple is of course subjective, but generally it means something like this:

Get
  Return _memberVar
End Get
Set (value as YourTypeHere)
  If value = _memberVar Then Exit Property
  _memberVar = value
  OnPropertyNameChanged()
End Set


and the OnPropertyNameChanged would raise any events and perform any other state changes that come from setting the property (eg: when PropertyA to false, PropertyB must be 0).
GeneralRe: Properties verses Functions Pin
supercat931-Jul-08 12:14
supercat931-Jul-08 12:14 
AnswerRe: Properties verses Functions Pin
Gregory Gadow31-Jul-08 7:17
Gregory Gadow31-Jul-08 7:17 
QuestionNeed extra properties for the tables and as well for columns in a typed dataset Pin
its-ravi-b4u30-Jul-08 23:16
its-ravi-b4u30-Jul-08 23:16 
AnswerRe: Need extra properties for the tables and as well for columns in a typed dataset Pin
Christian Graus31-Jul-08 0:19
protectorChristian Graus31-Jul-08 0:19 
GeneralRe: Need extra properties for the tables and as well for columns in a typed dataset Pin
its-ravi-b4u31-Jul-08 1:27
its-ravi-b4u31-Jul-08 1:27 
GeneralRe: Need extra properties for the tables and as well for columns in a typed dataset Pin
Paddy Boyd31-Jul-08 3:21
Paddy Boyd31-Jul-08 3:21 
GeneralRe: Need extra properties for the tables and as well for columns in a typed dataset Pin
its-ravi-b4u31-Jul-08 4:06
its-ravi-b4u31-Jul-08 4:06 
QuestionHow to extract records from data table object Pin
Rameez Raja30-Jul-08 22:57
Rameez Raja30-Jul-08 22:57 
AnswerRe: How to extract records from data table object Pin
Guffa30-Jul-08 23:57
Guffa30-Jul-08 23:57 
GeneralRe: How to extract records from data table object Pin
Rameez Raja31-Jul-08 0:26
Rameez Raja31-Jul-08 0:26 
GeneralRe: How to extract records from data table object Pin
Ashfield31-Jul-08 1:27
Ashfield31-Jul-08 1:27 
GeneralRe: How to extract records from data table object Pin
Jon_Boy31-Jul-08 1:52
Jon_Boy31-Jul-08 1:52 
AnswerRe: How to extract records from data table object Pin
Steven J Jowett31-Jul-08 1:48
Steven J Jowett31-Jul-08 1:48 
QuestionADODB connection Pin
tatchung30-Jul-08 22:40
tatchung30-Jul-08 22:40 
AnswerRe: ADODB connection Pin
ChandraRam30-Jul-08 23:27
ChandraRam30-Jul-08 23:27 
QuestionVB.Net Pin
K.Thota30-Jul-08 21:55
K.Thota30-Jul-08 21:55 
AnswerRe: VB.Net Pin
Christian Graus30-Jul-08 23:58
protectorChristian Graus30-Jul-08 23:58 

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.