Autres informations

Linkdump

» In Defense of The Jack of All Trades

Un article intéressant sur les couteaux Suisse de l'informatique.

  Pas de commentaire |
» Créez vos sitemaps en ligne

Le site xml-sitemaps.com vous permet de créer un sitemap de votre site en ligne.  Très utile pour le SEO.

  Pas de commentaire |
» namechk.com

Namechk.com permet de vérifier la disponibilité d'un nom d'usager sur 130 sites différents.  Très utile lorsque l'on tente de se trouver un pseudo branché!

  Pas de commentaire |
» 150 des meilleurs jeux flash

Liste de 150 des meilleurs jeux flash tel que répertorié par TechCult.

  Pas de commentaire |
» Are my sites up?

Site utile pour vous aviser si un site est disponible ou non: aremysitesup.com

  Pas de commentaire |
» Defraggler

Défragmentez les fichiers que vous voulez.

  Pas de commentaire |
» Format Factory

Un convertisseur de fichier multimédia.  Il permet de convertir de tous à mp4, mp3, jpg, 3gp, wma, png, avi, aac, ico, wmv, mmf, bmp, psp mp4, mpg, amr, gif, tiff et encore plus...

  Pas de commentaire |

« Dynacom Synergy: An o… | Accueil | Comment empêcher un f… »

Synergy: Working with a combobox

Vendredi 19 Juin 2009 at 4:14 pm. Balises utilisées: ,

This article covers how to interact with a combobox or if you prefer a DynaDropdownList.

Note: The links referenced in this article are about Visual Basic 6 but can easily apply to VBScript.

Properties

Property Data Type Description Reference
Appearance Long Returns or sets the paint style of controls on an MDIForm or Form object at design time. Read-only at run time. Appearance Property
BackColor Long BackColor returns or sets the background color of an object. BackColor, ForeColor Properties
Control Object

DataBoundInterface DynaDropdownList

Enabled Boolean Returns or sets a value that determines whether a form or control can respond to user-generated events. Enabled Property
Font Font Returns a Font object. Font Property
ForeColor Long BackColor returns or sets the background color of an object. BackColor, ForeColor Properties
ItemData Long Returns or sets a specific number for each item in a ComboBox or ListBox control. ItemData Property
List String Returns or sets the items contained in a control's list portion. List Property
ListCount Integer Returns the number of items in the list portion of a control. ListCount Property
ListIndex Integer Returns or sets the index of the currently selected item in the control. Not available at design time. ListIndex Property
Locked Boolean Returns or sets a value indicating whether a control can be edited. Locked Property
MouseIcon Picture Returns or sets a custom mouse icon. MouseIcon Property
MousePointer Long Returns or sets a value indicating the type of mouse pointer displayed when the mouse is over a particular part of an object at run time. MousePointer Property
NewIndex Integer Returns the index of the item most recently added to a ComboBox or ListBox control. Read only at run time. NewIndex Property
Sorted Boolean Returns a value indicating whether the elements of a control are automatically sorted alphabetically. Sorted Property
ToolTipText String Returns or sets a ToolTip. ToolTipText Property
ValueRequired Boolean

Methods

Method Parameters Description Reference
AddItem item: Required. string expression specifying the item to add to the object. Adds an item to a ListBox or ComboBox control AddItem Method
RemoveItem index: Required. Integer representing the position within the object of the item remove. Removes an item from a ListBox or ComboBox control RemoveItem Method
Clear None Clears the contents of a ListBox or ComboBox Clear Method

Examples

Adding an item

Controls("cboItems").Object.Control.AddItem "Item 1"

Removing an item

Controls("cboItems").Object.Control.RemoveItem 1

Clear a combobox

Controls("cboItems").Object.Control.Clear

Retrieve the selected item

Controls("cboItems").Object.List(Controls("cboItems")
.Object.ListIndex)

Loop through all items

'Declare local variables
Dim intItemIndex 'As Integer
Dim cboItems 'As DynaDropdownList
Dim i 'As Integer

'Initialize local variables
intItemIndex = -1
Set cboItems = Controls("cboItems").Object

'Find a specific item
For i = 0 To cboItems.ListCount - 1
    If cboItems.List(i) = "Item 1" Then
        intItemIndex = i
    End If
Next

'If item is not in the combobox, add it
If intItemIndex = -1 Then
    cboItems.AddItem "Item 1"
ElseIf intItemIndex > -1 Then
    cboItems.RemoveItem intItemIndex
End If

Pas de commentaire



  
Emoticones

Désolé pour la question mais je me fais spammer.
 



Retenir les informations personnelles ?:
Cacher nom de courriel:

Précision : Toutes les balises HTML sauf <b> et <i> seront supprimées de votre commentaire. Vous pouvez créer des liens juste en entrant l'URL ou l'adresse de courriel.
 

À propos

Bonjour et bienvenue sur le site officiel de Eric Duhaime. Pas Eric Duhaime qui change de partie politique comme il change de chemise mais le vrai Eric Duhaime, celui qui travail en informatique depuis plus de 10 ans.

Nuage de balises

Archives

Catégories

Derniers commentaires

Dderm (Ma critique (ou m…): Dsl Éric, j’ai vu ton nom seulement après avoir posté le message… Tu devrais signer plus clairement …
Dderm (Ma critique (ou m…): Qui que soit l’auteur de l’article d’opinion présenté ci-haut, je te remercie. Tu expliques très bie…
Stephane (Ma critique (ou m…): Une Vrai Arnaque. Soyez extrenement vigilant. etant un expert en informatique. je deconseille fo…
Franck (Ma critique (ou m…): C’est dommage, mais comme dit le proverbe, quand c trop beau pour etre vrai, c’est surment que ce ne…
Brian (Ma critique (ou m…): Très bien faite ta critique!!c’est une vraie arnaque!,et ebay est 100x mieux!.C’est beaucoup mieux d…
Steve (Ma critique (ou m…): BIDOU.CA . quel belle Crosse….je comprends vraiment pas pk les gens vont sur ce site pathétique. Oui…

Liens

Rechercher

Stuff

Motorisé par PivotX - 2.0.0: beta 12d
Fil XML (RSS 1.0)
XML: Atom Feed