/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
"List" property category
Fra : Henning Berggren Jør~


Dato : 09-10-01 19:11

Hi there,

anyone knows how to make a custom property on a user control, which is shown
as a list in the property list... - like the list property in a listbox
where you can enter the list values (seperated with a Ctrl-Enter).

I've tried to make a property by this:

--- START ---
Private mList(10) As String

Public Property Get List(Index As Integer) As String
List = mList(Index)
End Property

Public Property Let List(Index As Integer, Value As String)
mList(Index) = Value
End Property
--- END ---

And set the Property Category (in the Procedure Attributes) to "List".

I thought this would have been it, but it doesn't seem to work.

What do I do wrong?

Regards, Henning



 
 
Jan Røhmer Christens~ (09-10-2001)
Kommentar
Fra : Jan Røhmer Christens~


Dato : 09-10-01 22:04

> I've tried to make a property by this:
>
> --- START ---
> Private mList(10) As String
>
> Public Property Get List(Index As Integer) As String
> List = mList(Index)
> End Property
I would have written it like thise
Public sub GetList(index as integer) as string
GetList=mList(index)
End Sub

>
> Public Property Let List(Index As Integer, Value As String)
> mList(Index) = Value
> End Property
> --- END ---

and thise like
Public Sub LetList(index as integer, Value as string)
mlist(index) = Value
end sub

But i dont know.. havent testet it.. was just quick to reply!




Henning Berggren (10-10-2001)
Kommentar
Fra : Henning Berggren


Dato : 10-10-01 08:01

> I've tried to make a property by this:
>
> --- START ---
> Private mList(10) As String
>
> Public Property Get List(Index As Integer) As String
> List = mList(Index)
> End Property
I would have written it like thise
Public sub GetList(index as integer) as string
GetList=mList(index)
End Sub
>
> Public Property Let List(Index As Integer, Value As String)
> mList(Index) = Value
> End Property
> --- END ---
and thise like
Public Sub LetList(index as integer, Value as string)
mlist(index) = Value
end sub

As functions and subs are not properties, the LetList and GetList
aren't visible in the property list window... - you have to use
property for this task.

- Henning

Jan Røhmer Christens~ (10-10-2001)
Kommentar
Fra : Jan Røhmer Christens~


Dato : 10-10-01 08:45

> As functions and subs are not properties, the LetList and GetList
> aren't visible in the property list window... - you have to use
> property for this task.
>
Ok sorry then it no use :)




Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408889
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste