[VB6] Collection comme propriété d'un contrôle

Collection comme propriété d'un contrôle [VB6] - VB/VBA/VBS - Programmation

Marsh Posté le 02-09-2003 à 11:25:26    

Salut,
Comment on définie une collection comme propriété d'un contrôle ?
pour un string on a par exemple :
 

Dim strTo As String
...
Public Property Let SendTo(ByVal strTemp As String)
  strTo = strTemp
  PropertyChanged "SendTo"
End Property
...
Public Property Get SendTo() As String
  SendTo = strTo
End Property


 
mais je suppose que C pas tout à fait la même chose pour une Collection...
 
C koi kome la bonne manière ?
 
 :hello:


Message édité par Poipoi le 02-09-2003 à 11:25:58

---------------
Des bons sites pour Delphi? http://forum.hardware.fr/forum2.php3?post=16838&cat=10 -- informaticien -- http://www.z0rglub.com/phpwebgallery/ -- Delphi :love:
Reply

Marsh Posté le 02-09-2003 à 11:25:26   

Reply

Marsh Posté le 02-09-2003 à 11:33:56    

La collection est un objet, ce n'est donc pas le Let mais le Set que tu dois utiliser dans ta déclaration de propriété. Pour le Get, c'est pareil que le String.

Reply

Marsh Posté le 02-09-2003 à 11:42:36    

le set ok G ça :
 

Public Property Set MyColl(oTemp As Collection)
    Set oMyColl.Attachments = oTemp
End Property


 
mais pour le get ?
 

Public Property Get MyColl() As Collection
    Set Attachments = oMyColl.Attachments
End Property


---------------
Des bons sites pour Delphi? http://forum.hardware.fr/forum2.php3?post=16838&cat=10 -- informaticien -- http://www.z0rglub.com/phpwebgallery/ -- Delphi :love:
Reply

Marsh Posté le 02-09-2003 à 11:54:27    

pareil que pour un autre type: tu spécifies le nom de la propriété comme réceptacle:
 

Code :
  1. Public Property Get MyColl() As Collection
  2.    Set MyColl = oMyColl.Attachments
  3. End Property

Reply

Marsh Posté le 02-09-2003 à 16:31:24    

ah ces noob  :pfff:  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 :whistle: salut poire  :hello:


---------------
"I wonder if the internal negative pressure in self pumping toothpaste tubes is adjusted for different market altitudes." John Carmack
Reply

Marsh Posté le 02-09-2003 à 16:41:06    

mareek a écrit :

ah ces noob  :pfff:  
 
 
 :whistle: salut poire  :hello:  


 :lol:  :lol:  :lol:  
 
Désolé G po l'habitude de faire des contrôle en VB (vu comment C la merde  :o )
 ;)  
 
 :hello:


---------------
Des bons sites pour Delphi? http://forum.hardware.fr/forum2.php3?post=16838&cat=10 -- informaticien -- http://www.z0rglub.com/phpwebgallery/ -- Delphi :love:
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed