'Voici le code de la form qui vous permet d'intégrer 'un formulaire d'enregistrement à votre application. ' 'COMMENT RECUPERER CE CODE ? '1 - Enregistrez ce fichier sur votre ordinateur. '2 - Renommez le avec une extension FRM. '3 - Démarrer un nouveau projet Visual Basic* ou ouvrez un projet existant. '4 - Ajoutez le fichier à ce projet. '5 - Double-cliquez sur la form dans l'explorateur de projet pour afficher la form. ' ' '*propriété de MicroSoft ' '********************* VOICI LE CODE DE LA FORM ************************** ' VERSION 5.00 Begin VB.Form frmEnregistrement BorderStyle = 3 'Fixed Dialog Caption = "Enregistrement" ClientHeight = 7965 ClientLeft = 3600 ClientTop = 1335 ClientWidth = 6420 Icon = "frmEnregistrement.frx":0000 KeyPreview = -1 'True LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 7965 ScaleWidth = 6420 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Begin VB.CommandButton cmdQuitter Cancel = -1 'True Caption = "&Quitter" Height = 435 Left = 4680 TabIndex = 44 ToolTipText = "Quitter" Top = 7500 Width = 1695 End Begin VB.Frame fraCoordonnees Height = 7395 Left = 60 TabIndex = 31 Top = 0 Width = 6315 Begin VB.Frame fraSupplement Height = 2535 Left = -2700 TabIndex = 53 Top = 4920 Visible = 0 'False Width = 6075 Begin VB.ListBox lstChoix Appearance = 0 'Flat Height = 1005 ItemData = "frmEnregistrement.frx":0442 Left = 3360 List = "frmEnregistrement.frx":0455 TabIndex = 30 ToolTipText = "Liste de connaissance" Top = 720 Visible = 0 'False Width = 1695 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 675 Index = 17 Left = 180 MultiLine = -1 'True TabIndex = 62 ToolTipText = "Remarques et suggestions" Top = 1680 Width = 5715 End Begin VB.TextBox txtCoordonnees Alignment = 2 'Center Appearance = 0 'Flat Height = 255 Index = 16 Left = 3360 MaxLength = 2 TabIndex = 60 ToolTipText = "Remarques et suggestions" Top = 1080 Width = 855 End Begin VB.CommandButton cmdListe Caption = "<" Height = 255 Left = 5100 TabIndex = 26 ToolTipText = "Liste de connaissance" Top = 480 Width = 255 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 15 Left = 1500 TabIndex = 28 ToolTipText = "Remarques et suggestions" Top = 780 Width = 3555 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 14 Left = 3360 Locked = -1 'True TabIndex = 27 ToolTipText = "Comment avez-vous connu ce programme ?" Top = 480 Width = 1695 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Si autre, précisez:" Height = 195 Index = 18 Left = 180 TabIndex = 61 Top = 840 Width = 1260 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Merci de remplir ces quelques petits renseignements facultatifs" BeginProperty Font Name = "MS Serif" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 165 Index = 14 Left = 180 TabIndex = 57 Top = 240 Width = 3780 End Begin VB.Label lblFermer Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Caption = "X" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 270 Left = 5820 TabIndex = 29 ToolTipText = "Fermer" Top = 180 Width = 180 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Vos remarques et suggestions:" Height = 195 Index = 16 Left = 180 TabIndex = 56 Top = 1440 Width = 2160 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Attribuez une note sur 10 à ce programme:" Height = 195 Index = 15 Left = 180 TabIndex = 55 Top = 1140 Width = 3000 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Comment avez-vous connu ce programme ?" Height = 195 Index = 13 Left = 180 TabIndex = 54 Top = 540 Width = 3120 End End Begin VB.CommandButton cmdEnregistrement Caption = "&Afficher" Enabled = 0 'False Height = 435 Left = 4185 TabIndex = 21 ToolTipText = "Afficher le formulaire" Top = 5040 Width = 1335 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 12 Left = 1260 TabIndex = 16 ToolTipText = "Nom du produit" Top = 3840 Width = 4875 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 2 Left = 1260 TabIndex = 6 ToolTipText = "Votre prénom" Top = 720 Width = 1815 End Begin VB.CommandButton cmdPlus Caption = "?" Height = 255 Left = 5760 TabIndex = 17 ToolTipText = "Renseignements complémentaires" Top = 4620 Width = 375 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 0 Left = 1260 TabIndex = 4 ToolTipText = "Votre nom" Top = 360 Width = 1815 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 11 Left = 1260 TabIndex = 15 ToolTipText = "Votre adresse de site Internet" Top = 3180 Width = 4875 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 10 Left = 1260 TabIndex = 14 ToolTipText = "Votre adresse de messagerie" Top = 2820 Width = 4875 End Begin VB.TextBox txtAdresseAuteur Appearance = 0 'Flat Height = 735 Left = 180 Locked = -1 'True MultiLine = -1 'True TabIndex = 23 ToolTipText = "Adresse de l'auteur" Top = 6000 Width = 3915 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 9 Left = 4860 TabIndex = 13 ToolTipText = "Votre numéro de fax" Top = 2460 Width = 1275 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 8 Left = 3000 TabIndex = 12 ToolTipText = "Votre numéro de téléphone" Top = 2460 Width = 1275 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 7 Left = 1260 TabIndex = 11 ToolTipText = "Votre numéro de téléphone mobile" Top = 2460 Width = 1275 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 6 Left = 1260 TabIndex = 10 ToolTipText = "Votre pays" Top = 2100 Width = 4875 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 5 Left = 3060 TabIndex = 9 ToolTipText = "Votre ville" Top = 1740 Width = 3075 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 4 Left = 1260 TabIndex = 8 ToolTipText = "Votre numéro de code postal" Top = 1740 Width = 1275 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 555 Index = 3 Left = 1260 MultiLine = -1 'True TabIndex = 7 ToolTipText = "Votre adresse" Top = 1080 Width = 4875 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 1 Left = 3960 TabIndex = 5 ToolTipText = "Le nom de votre société" Top = 360 Width = 2175 End Begin VB.OptionButton optChoix Appearance = 0 'Flat Caption = "Fichier rtf" ForeColor = &H80000008& Height = 195 Index = 2 Left = 2700 TabIndex = 20 ToolTipText = "Fichier rtf" Top = 5160 Width = 1095 End Begin VB.OptionButton optChoix Appearance = 0 'Flat Caption = "Fichier texte" ForeColor = &H80000008& Height = 195 Index = 1 Left = 1320 TabIndex = 19 ToolTipText = "Fichier texte" Top = 5160 Width = 1155 End Begin VB.OptionButton optChoix Appearance = 0 'Flat Caption = "E-mail" ForeColor = &H80000008& Height = 195 Index = 0 Left = 180 TabIndex = 18 ToolTipText = "e-mail" Top = 5160 Width = 795 End Begin VB.TextBox txtCoordonnees Appearance = 0 'Flat Height = 255 Index = 13 Left = 1260 Locked = -1 'True TabIndex = 59 ToolTipText = "Numéro du produit" Top = 4140 Width = 4875 End Begin VB.CommandButton cmdImprimer Enabled = 0 'False Height = 435 Left = 5580 Picture = "frmEnregistrement.frx":0484 Style = 1 'Graphical TabIndex = 22 ToolTipText = "Imprimer le formulaire" Top = 5040 Width = 555 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Pays:" Height = 195 Index = 17 Left = 180 TabIndex = 58 Top = 2160 Width = 390 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& Index = 2 X1 = 180 X2 = 6120 Y1 = 4920 Y2 = 4920 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& Index = 3 X1 = 180 X2 = 6120 Y1 = 5580 Y2 = 5580 End Begin VB.Label Label4 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Prenez quelques secondes pour répondre à quelques questions.........................." Height = 195 Index = 2 Left = 180 TabIndex = 52 Top = 4680 Width = 5670 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Société:" Height = 195 Index = 12 Left = 3300 TabIndex = 51 Top = 420 Width = 585 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& Index = 1 X1 = 180 X2 = 6120 Y1 = 3660 Y2 = 3660 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Numéro:" Height = 195 Index = 11 Left = 180 TabIndex = 50 Top = 4200 Width = 600 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Produit:" Height = 195 Index = 10 Left = 180 TabIndex = 49 Top = 3900 Width = 540 End Begin VB.Label Label4 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Mes coordonnées:" Height = 195 Index = 3 Left = 180 TabIndex = 48 Top = 5760 Width = 1320 End Begin VB.Label lblSite AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "SITE" BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = -1 'True Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 210 Left = 1320 MouseIcon = "frmEnregistrement.frx":0586 MousePointer = 99 'Custom TabIndex = 25 ToolTipText = "Site Internet de l'auteur" Top = 7080 Width = 315 End Begin VB.Label lblMail AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "MAIL" BeginProperty Font Name = "Arial" Size = 8.25 Charset = 0 Weight = 400 Underline = -1 'True Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF0000& Height = 210 Left = 1320 MouseIcon = "frmEnregistrement.frx":0890 MousePointer = 99 'Custom TabIndex = 24 ToolTipText = "Adresse e-mail de l'auteur" Top = 6780 Width = 360 End Begin VB.Label Label4 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "E-mail:" Height = 195 Index = 1 Left = 180 TabIndex = 47 Top = 6780 Width = 465 End Begin VB.Label Label4 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Site Internet:" Height = 195 Index = 0 Left = 180 TabIndex = 46 Top = 7080 Width = 900 End Begin VB.Label lblSociete AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "db2p" BeginProperty Font Name = "Arial" Size = 15.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00C00000& Height = 360 Left = 4980 TabIndex = 45 ToolTipText = "Logo" Top = 6120 Width = 765 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Site Internet:" Height = 195 Index = 9 Left = 180 TabIndex = 41 Top = 3240 Width = 900 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "E-mail:" Height = 195 Index = 8 Left = 180 TabIndex = 40 Top = 2880 Width = 465 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Mobile:" Height = 195 Index = 7 Left = 180 TabIndex = 39 Top = 2520 Width = 510 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Fax:" Height = 195 Index = 6 Left = 4440 TabIndex = 38 Top = 2520 Width = 300 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Tél:" Height = 195 Index = 5 Left = 2640 TabIndex = 37 Top = 2520 Width = 270 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Ville:" Height = 195 Index = 4 Left = 2700 TabIndex = 36 Top = 1800 Width = 330 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Code postal:" Height = 195 Index = 3 Left = 180 TabIndex = 35 Top = 1860 Width = 885 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Adresse:" Height = 195 Index = 2 Left = 180 TabIndex = 34 Top = 1140 Width = 615 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Prénom:" Height = 195 Index = 1 Left = 180 TabIndex = 33 Top = 780 Width = 585 End Begin VB.Label Label1 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Nom:" Height = 195 Index = 0 Left = 180 TabIndex = 32 Top = 420 Width = 375 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& Index = 0 X1 = 180 X2 = 6120 Y1 = 4560 Y2 = 4560 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 2 Index = 0 X1 = 180 X2 = 6120 Y1 = 4560 Y2 = 4560 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 2 Index = 1 X1 = 180 X2 = 6120 Y1 = 3660 Y2 = 3660 End Begin VB.Line Line1 BorderColor = &H00FFFFFF& Index = 4 X1 = 180 X2 = 6120 Y1 = 5640 Y2 = 5640 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 2 Index = 2 X1 = 180 X2 = 6120 Y1 = 5640 Y2 = 5640 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 2 Index = 3 X1 = 180 X2 = 6120 Y1 = 5580 Y2 = 5580 End Begin VB.Line Line2 BorderColor = &H00000000& BorderWidth = 2 Index = 4 X1 = 180 X2 = 6120 Y1 = 4920 Y2 = 4920 End End Begin VB.Frame fraInformation Height = 7395 Left = 60 TabIndex = 42 Top = 0 Width = 6315 Begin VB.CommandButton cmdOK Caption = "&Enregistrement" Enabled = 0 'False Height = 495 Left = 2340 TabIndex = 3 ToolTipText = "Enregistrement" Top = 6780 Width = 1875 End Begin VB.OptionButton optAcceptation Appearance = 0 'Flat Caption = "Je n'accepte pas" ForeColor = &H80000008& Height = 255 Index = 1 Left = 240 TabIndex = 2 ToolTipText = "Je n'accepte pas" Top = 7080 Width = 1635 End Begin VB.OptionButton optAcceptation Appearance = 0 'Flat Caption = "J'accepte" ForeColor = &H80000008& Height = 255 Index = 0 Left = 240 TabIndex = 1 ToolTipText = "J'accepte" Top = 6780 Width = 1155 End Begin VB.TextBox txtInformations Appearance = 0 'Flat Height = 6135 Left = 240 Locked = -1 'True MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 0 ToolTipText = "Informations" Top = 480 Width = 5835 End Begin VB.Label Label2 AutoSize = -1 'True BackStyle = 0 'Transparent Caption = "Informations" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 225 Left = 240 TabIndex = 43 Top = 240 Width = 1080 End End End Attribute VB_Name = "frmEnregistrement" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' 'VARIABLES Private fichier_html As String 'le formuailre d'enregistrement au format html Private fichier_rtf As String 'le formuailre d'enregistrement au format rtf Private fichier_texte As String 'le formuailre d'enregistrement au format rtf ' 'API Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Public Sub Executer(fichier As String, mode As String, autre_type As Boolean) ' If autre_type = True Then GoTo suite 'adresse e-mail ou site, pas de verification de fichier ' If Verif_Fichier(fichier) = False Then MsgBox fichier & vbCrLf & " est introuvable. Assurez-vous que celui-ci doit se trouver dans le dossier:" & vbCrLf & App.Path, vbCritical, "Fichier introuvable" Exit Sub End If ' suite: Dim rep& rep = ShellExecute(Me.hWnd, mode, fichier, ByVal 0&, 0&, 1) If rep = 31 Then MsgBox "Aucune application associée avec le type de fichier " & UCase$(Right$(fichier, 3)) & " .", vbInformation, "Information" Exit Sub End If ' End Sub Public Sub CreerFichierHtml() ' Dim html As String html = "" Dim num_fich% num_fich = FreeFile fichier_html = chemin_app & "formulaire.htm" ' html = "" & vbCrLf html = html & "
" & vbCrLf html = html & "" & vbCrLf html = html & " FORMULAIRE D'ENREGISTREMENT
Ce " & vbCrLf
html = html & "formulaire n'a aucune valeur commerciale. Vous n'avez aucune obligation de l'envoyer. " & vbCrLf
html = html & "Il est simplement destiné à savoir à peu près combien " & vbCrLf
html = html & "de personnes utilisent ce programme et dans quelle étendue celui-ci " & vbCrLf
html = html & "est apprécié. Toutes les données envoyées restent " & vbCrLf
html = html & "strictement confidentielles et ne sont en aucun cas sujettes à quelques " & vbCrLf
html = html & "commercialisations que ce soit selon la loi de la liberté informatique " & vbCrLf
html = html & "en vigueur. Alors, un petit geste, juste 2 minutes de votre temps pour remplir " & vbCrLf
html = html & "celui-ci. MERCI.