Click here to Skip to main content
15,917,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
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 
I use two criteria: Will it behave like a variable or like a function? If it will behave like a variable, do I need to do anything other that store/retrieve the data?

If all I need is some place to store data, I will write a private variable declaration; if I don't need to do the extra coding, I don't. If the value is static, I write a private constant declaration.

VB
Private X As Integer
Private Const CaptionText As String = "Enter some data"
If the value is dynamic and read-only, then I will write a private function.
VB
Private Function FolderPath() As String
    Return String.Format("{0}\{1}", PathTextbox.Text, FileTextbox.Text)
End Function

If I need to validate the data when it is retrieved or stored, do some other kind of processing or perform multiple operations with that value, that is when I will write a private property with at least a Get.

VB
Private pStringList As List(Of String)
Private ReadOnly Property StringList() As List(Of String)
    Get
        If pStringList Is Nothing Then pStringList = New List(Of String)
        Return pStringList
    End Get
End Property

Private pMyHeight As Integer
Private Property MyHeight() As Integer
    Get
        Return pMyHeight
    End Get
    Set(ByVal value As Integer)
        Dim H As Integer = MinHeight
        If value > MaxHeight Then
            H = MaxHeight
        ElseIf value > MinHeight Then
            H = value
        End If
        pMyHeight = H
        ResizeMe()
    End Set
End Property

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 PinPopular
Christian Graus30-Jul-08 23:58
protectorChristian Graus30-Jul-08 23:58 
GeneralRe: VB.Net Pin
Jon_Boy31-Jul-08 1:56
Jon_Boy31-Jul-08 1:56 
GeneralRe: VB.Net Pin
LloydA1112-Aug-08 4:08
LloydA1112-Aug-08 4:08 

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.