Click here to Skip to main content
15,891,473 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Taylor Kobani27-Jun-07 1:55
Taylor Kobani27-Jun-07 1:55 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 2:04
MartyK200727-Jun-07 2:04 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Dave Kreskowiak27-Jun-07 3:49
mveDave Kreskowiak27-Jun-07 3:49 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 3:53
MartyK200727-Jun-07 3:53 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Dave Kreskowiak27-Jun-07 4:10
mveDave Kreskowiak27-Jun-07 4:10 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 4:31
MartyK200727-Jun-07 4:31 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Dave Kreskowiak27-Jun-07 5:01
mveDave Kreskowiak27-Jun-07 5:01 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class [modified] Pin
Taylor Kobani27-Jun-07 6:46
Taylor Kobani27-Jun-07 6:46 
Write another program that gets the name of the properties ,adds them to a list and finally makes the code for you to add to your class.


The function below may help you

Function Generate(ByVal mc As Collection) As String
        Dim str As String
        For i As Integer = 1 To mc.Count

            str &= "Public Property " & mc(i) & "() As String" * vbCrLf & _
"Get" & vbCrLf & "Return MyDataCol(""" & mc(i) & """)" & vbCrLf & _
"End Get" & vbCrLf & "Set(ByVal value As String)" & vbCrLf & _
"MyDataCol.Remove(""" & mc(i) & """)" & vbCrLf & "MyDataCol.Add(value, """ & mc(i) & """)" & _
vbCrLf & "End Set" & vbCrLf & "End Property" & vbCrLf
        Next

        Return str
    End Function


where mc is a collection of property names



A.E.K

GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Dave Kreskowiak27-Jun-07 7:09
mveDave Kreskowiak27-Jun-07 7:09 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 21:11
MartyK200727-Jun-07 21:11 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
Dave Kreskowiak28-Jun-07 2:40
mveDave Kreskowiak28-Jun-07 2:40 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200728-Jun-07 3:08
MartyK200728-Jun-07 3:08 
AnswerRe: There must be a better way to enter lots of strongly typed properties in a class Pin
SHatchard27-Jun-07 3:51
SHatchard27-Jun-07 3:51 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 4:04
MartyK200727-Jun-07 4:04 
Questioncolored area in center all way down ? Pin
porsti26-Jun-07 21:57
porsti26-Jun-07 21:57 
AnswerRe: colored area in center all way down ? Pin
Tamimi - Code26-Jun-07 23:10
Tamimi - Code26-Jun-07 23:10 
GeneralRe: colored area in center all way down ? Pin
porsti26-Jun-07 23:55
porsti26-Jun-07 23:55 
Questionc# to vb.net 2005 Pin
Sonia Gupta26-Jun-07 20:12
Sonia Gupta26-Jun-07 20:12 
AnswerRe: c# to vb.net 2005 Pin
Christian Graus26-Jun-07 20:17
protectorChristian Graus26-Jun-07 20:17 
GeneralRe: c# to vb.net 2005 Pin
Sonia Gupta26-Jun-07 21:01
Sonia Gupta26-Jun-07 21:01 
Questionhow to make a button on a datagrid cell... Pin
cutequencher26-Jun-07 19:28
cutequencher26-Jun-07 19:28 
AnswerRe: how to make a button on a datagrid cell... Pin
Rupesh Kumar Swami26-Jun-07 19:38
Rupesh Kumar Swami26-Jun-07 19:38 
GeneralRe: how to make a button on a datagrid cell... Pin
cutequencher26-Jun-07 20:08
cutequencher26-Jun-07 20:08 
GeneralRe: how to make a button on a datagrid cell... Pin
Rupesh Kumar Swami26-Jun-07 20:33
Rupesh Kumar Swami26-Jun-07 20:33 
GeneralRe: how to make a button on a datagrid cell... Pin
cutequencher26-Jun-07 22:51
cutequencher26-Jun-07 22:51 

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.