Click here to Skip to main content
15,900,724 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionTyped Dataset Pin
ShuklaGirish26-Jun-07 23:36
ShuklaGirish26-Jun-07 23:36 
Questionbutton and combobox in a Component Pin
anujose26-Jun-07 23:13
anujose26-Jun-07 23:13 
AnswerRe: button and combobox in a Component Pin
Tamimi - Code26-Jun-07 23:36
Tamimi - Code26-Jun-07 23:36 
GeneralRe: button and combobox in a Component Pin
anujose26-Jun-07 23:39
anujose26-Jun-07 23:39 
GeneralRe: button and combobox in a Component Pin
Tamimi - Code26-Jun-07 23:51
Tamimi - Code26-Jun-07 23:51 
AnswerRe: button and combobox in a Component Pin
Craster26-Jun-07 23:47
Craster26-Jun-07 23:47 
AnswerRe: button and combobox in a Component Pin
Dave Kreskowiak27-Jun-07 3:50
mveDave Kreskowiak27-Jun-07 3:50 
QuestionThere must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200726-Jun-07 22:41
MartyK200726-Jun-07 22:41 
Hello,
I am trying to write a strongly typed object class
(so I can bind the properties of the class object to form controls) along the lines of:


Public Class foo
Private _myCol As Collection
Public Property Name() As String
Get
Return _myCol("Name")
End Get
Set(ByVal value As String)
_myCol.Remove("Name")
_myCol.Add(value, "Name")
End Set
End Property
Public Property Title() As String
Get
Return _myCol("Title")
End Get
Set(ByVal value As String)
_myCol.Remove("Title")
_myCol.Add(value, "Title")
End Set
End Property
End Class

This is quite simply awful. If I use an array instead of a collection I can get rid of the
collection remove and add rubbish.
In effect I could replace
Return _myCol("Title")
with
Return _myArray(1)

This means that I have to relate each property to an index (Name to 1 and Title to 2 for example)
and it means that when I create the class I have to manually type this relationship in.

The real problem with this is that I anticpate having lots of classes like this each with lots
of properties and frankly I am a bit lazy and dont want to physically key them in like this.

One option was to bind the controls to an exposed dataset in my foo class instead but I dont
want to do that. I want to expose Foo.Name and Foo.Title etc.

There must be an easier way than that above - any ideas?? (either a template based way of entering
them into visual studio or a completly new way of coding them)

thanks in advance
Martin


-- modified at 5:25 Wednesday 27th June, 2007

life is a bowl of cherries
go on take a byte

AnswerRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MohammadAmiry27-Jun-07 0:41
MohammadAmiry27-Jun-07 0:41 
GeneralRe: There must be a better way to enter lots of strongly typed properties in a class Pin
MartyK200727-Jun-07 1:06
MartyK200727-Jun-07 1:06 
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 
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 

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.