Télécharger ang Exemple d'accés aux controles

HTA
Avatar de bbil
Responsable Visual Basic
Mise à jour le : 29/12/2010  ·   Licence : Autre  ·   Téléchargé 430 fois   ·   3 Ko  +
Présentation
Un exemple d'utilisations de contrôles d'édition en VBS/HTA
Téléchargement :






		
  1. <!--
  2. Auteur : bbil
  3. Date : 18/03/2009
  4. site : http://bbil.developpez.com/tutoriel/vbs/interface-hta/
  5. Fonction : contr?les
  6.  
  7. -->
  8. <head>
  9. <title>Les Contr?les</title>
  10. <HTA:APPLICATION
  11. APPLICATION="htaControles"
  12.  
  13. >
  14. </head>
  15. <script language="VBScript">
  16. Sub Window_Onload
  17. 'Liste box dynamique:
  18. CreerLstDyn
  19. end sub
  20. Sub CreerLstDyn
  21. For i = 1 to 10
  22. Set oOption = Document.createElement("OPTION")
  23. oOption.Text = "Opt" & i
  24. oOption.Value = "Option " & i
  25. lstDyn.Add(oOption)
  26. next
  27. end sub
  28. Sub affichNom
  29. Dim stCouleur
  30. Dim i
  31. for i = 0 to optCouleur.length -1
  32. if optCouleur(i).Checked then
  33. stCouleur = optCouleur(i).value
  34. exit for
  35. end if
  36. next
  37. Dim stTransport
  38. For i = 0 to chkTransport.length - 1
  39. if chkTransport(i).checked then
  40. stTransport = stTransport & chkTransport(i).value & ", "
  41. end if
  42. next
  43. Dim stSport
  44. For i = 0 to lstSports.length - 1
  45. if lstSports(i).Selected then
  46. stSport = stSport & lstSports(i).value & " "
  47. end if
  48. next
  49. MsgBox "Votre Nom est : " & txtNom.value & vbCrlf & _
  50. "Mot de passe : " & txtMotDePasse.value & vbCrlf & _
  51. "Couleur : " & stCouleur & vbCrlf & _
  52. "Moyens de transport : " & stTransport & vbCrlf & _
  53. "Sports pratiqu?s : " & stSport,vbExclamation,"interface-hta"
  54. Msgbox txtCommentaires.Value ,vbEclamation,"Vos commentaires"
  55. End Sub
  56. Sub ChoixChaine
  57. msgBox lstChaines.Value
  58. end sub
  59. Sub ChoixFichier
  60. msgbox inFichier.value
  61. end sub
  62. </script>
  63. <body>
  64. Saisir votre nom : <INPUT TYPE="text" NAME="txtNom" SIZE="20" MAXLENGTH="30" VALUE="bbil"><BR>
  65. Mot de passe : <INPUT TYPE="password" NAME="txtMotDePasse" TITLE="Saisir votre mot de passe" SIZE="20" MAXLENGTH="30" VALUE=""><BR>
  66. <BR>
  67. Votre couleur pr?f?r?e : <BR>
  68. <INPUT TYPE="radio" NAME="optCouleur" VALUE="Bleu" CHECKED>Bleu<BR>
  69. <INPUT TYPE="radio" NAME="optCouleur" VALUE="Rouge">Rouge<BR>
  70. <INPUT TYPE="radio" NAME="optCouleur" VALUE="Vert">Vert<BR>
  71. <BR>
  72. Vos moyens de transport pr?f?r?s ? : <BR>
  73. <INPUT TYPE="checkbox" NAME="chkTransport" VALUE="V?lo" CHECKED>V?lo<BR>
  74. <INPUT TYPE="checkbox" NAME="chkTransport" VALUE="Voiture"CHECKED>Voiture<BR>
  75. <INPUT TYPE="checkbox" NAME="chkTransport" VALUE="Marche">Marche ? pied<BR>
  76. <INPUT TYPE="checkbox" NAME="chkTransport" VALUE="train" >Train<BR>
  77. <INPUT TYPE="checkbox" NAME="chkTransport" VALUE="bus">Bus
  78. <BR><BR>
  79. <SELECT NAME="lstChaines" SIZE=4 onChange="ChoixChaine">
  80. <OPTION VALUE="TF1">TF1
  81. <OPTION VALUE="FR2">France 2
  82. <OPTION VALUE="FR3" SELECTED>France 3
  83. <OPTION VALUE="C+" >CANAL PLUS
  84. </SELECT>
  85. <BR>
  86. SIZE=4
  87. <BR><BR>
  88.  
  89. Sports pratiqu?s : <BR>
  90. <SELECT NAME="lstSports" SIZE=4 MULTIPLE>
  91. <OPTION VALUE="rugby">rugby
  92. <OPTION VALUE="foot">foot
  93. <OPTION VALUE="basket-ball" SELECTED>Basket
  94. <OPTION VALUE="hand-ball" >Hand
  95. </SELECT>
  96. <BR><BR>
  97.  
  98. Liste dynamique : <BR>
  99. <SELECT NAME="lstDyn">
  100. </SELECT>
  101. <BR><BR>
  102. Vos commentaires <BR>
  103. <TEXTAREA NAME="txtCommentaires" ROWS="3" COLS="40" >
  104. </TEXTAREA>
  105. <BR><BR>
  106. <input type="button" value="Aff" onClick="affichNom">
  107. <BR><BR>
  108. <INPUT TYPE="file" NAME="inFichier" SIZE="30" onChange="choixfichier">
  109. <input type="button" value="Validez Fichier" onClick="choixfichier">
  110. </body>
Developpez.com décline toute responsabilité quant à l'utilisation des différents éléments téléchargés.

Connexion

Identifiant
Mot de passe
S'inscrireMot de passe oublié ?
 
 
 
 
Partenaires

Hébergement Web