Accueil > > > GENERATEUR DE MESSAGES BOXS
GENERATEUR DE MESSAGES BOXS
Information sur la source
Description
Un petit programme tres simple que je compte bien ameliorer en un multi boxs generator tous est dans le zip g quand meme mis le code mais bon vu le nombre de controles qu'il y a vous aurez du mal a la faire fonctioner sans telecharger le zip, le code parait long mais c la meme chose c juste le nom de controle qui change
Source
- Option Explicit
- Dim v1, v2, v3, v4, v5, Title1, Picture1, Buton, v6, v7, v8, v9, v10, Title2, Pictur2, M As Integer
- Private Sub Check1_Click()
- If Check1.Value = 1 Then
- Check1.Caption = "Beep On"
- ElseIf Check1.Value = 0 Then
- Check1.Caption = "Beep Off"
- End If
- End Sub
- Private Sub Check2_Click()
- If Check2.Value = 1 Then
- Check2.Caption = "Masquer On"
- ElseIf Check1.Value = 0 Then
- Check2.Caption = "Masquer Off"
- End If
- End Sub
- Private Sub form_load()
- Option1(0).Value = True
- Option3(2).Value = True
- Option2(0).Value = True
- End Sub
- Private Sub Form_unload(cancel As Integer)
- End
- End Sub
- Private Sub Command3_Click()
- Unload Me
- End Sub
-
- 'generation de la msgbox
- Private Sub Command1_Click()
-
- If Option1(0).Value = True Then
- Picture1 = vbQuestion
- End If
- If Option1(1).Value = True Then
- Picture1 = vbInformation
- End If
- If Option1(2).Value = True Then
- Picture1 = vbExclamation
- End If
- If Option1(3).Value = True Then
- Picture1 = vbCritical
- End If
-
- If Option3(0).Value = True Then
- Buton = vbYesNo
- End If
- If Option3(1).Value = True Then
- Buton = vbYesNoCancel
- End If
- If Option3(2).Value = True Then
- Buton = vbOKOnly
- End If
- If Option3(3).Value = True Then
- Buton = vbOKCancel
- End If
- If Option3(5).Value = True Then
- Buton = vbRetryCancel
- End If
- If Option3(6).Value = True Then
- Buton = vbAbortRetryIgnore
- End If
- If Not Text1.Text = "" Then
- Title1 = Text1.Text
- End If
-
- If Not Text2.Text = "" Then
- v1 = Text2.Text & Chr(10)
- ElseIf Text2.Text = "Ligne 1" Then
- v1 = ""
- Else
- Resume Next
- End If
-
- If Not Text3.Text = "" Then
- v2 = Text3.Text & Chr(10)
- ElseIf Text3.Text = "Ligne 2" Then
- v2 = ""
- Else
- Resume Next
- End If
-
- If Not Text4.Text = "" Then
- v3 = Text4.Text & Chr(10)
- ElseIf Text4.Text = "Ligne 3" Then
- v3 = ""
- Else
- Resume Next
- End If
-
- If Not Text5.Text = "" Then
- v4 = Text5.Text & Chr(10)
- ElseIf Text5.Text = "Ligne 4" Then
- v4 = ""
- Else
- Resume Next
- End If
-
- If Not Text6.Text = "" Then
- v5 = Text6.Text
- ElseIf Text6.Text = "Ligne 5" Then
- v5 = ""
- Else
- Resume Next
- End If
- If Not Text1.Text = "" Then
- If Not Text1.Text = "Titre" Then
- If Not Text2.Text = "Ligne 1" Then
- If Not Text3.Text = "Ligne 2" Then
- If Not Text4.Text = "Ligne 3" Then
- If Not Text5.Text = "Ligne 4" Then
- If Not Text6.Text = "Ligne 5" Then
- msg0:
- Call mask
- Call bep
- M = MsgBox(v1 & v2 & v3 & v4 & v5, Buton + Picture1, Title1)
- If M = vbRetry Then
- GoTo msg0
- End If
- Me.Visible = True
- Exit Sub
- End If
- msg1:
- Call mask
- Call bep
- M = MsgBox(v1 & v2 & v3 & v4, Buton + Picture1, Title1)
- If M = vbRetry Then
- GoTo msg1
- End If
- Me.Visible = True
- Exit Sub
- End If
- msg2:
- Call mask
- Call bep
- M = MsgBox(v1 & v2 & v3, Buton + Picture1, Title1)
- If M = vbRetry Then
- GoTo msg2
- End If
- Me.Visible = True
- Exit Sub
- End If
- msg3:
- Call mask
- Call bep
- M = MsgBox(v1 & v2, Buton + Picture1, Title1)
- If M = vbRetry Then
- GoTo msg3
- End If
- Me.Visible = True
- Exit Sub
- End If
- msg4:
- Call mask
- Call bep
- M = MsgBox(v1, Buton + Picture1, Title1)
- Me.Visible = True
- If M = vbRetry Then
- GoTo msg4
- End If
- Exit Sub
- End If
- Me.Visible = True
- MsgBox "Vous devez paramètrer le reste de la boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
- Me.Visible = True
- Exit Sub
- Else
- Me.Visible = True
- MsgBox "Vous devez ecrire un titre pour votre boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
- Me.Visible = True
- Exit Sub
- End If
- Me.Visible = True
- MsgBox "Vous devez paramètrer une boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
- Me.Visible = True
- Exit Sub
- End If
- End Sub
- Private Sub mask()
- If Check2.Value = 1 Then
- Me.Visible = False
- ElseIf Check1.Value = 2 Then
- Me.Visible = True
- End If
- End Sub
- Private Sub bep()
- If Check1.Value = 1 Then
- Beep
- Beep
- Beep
- End If
- End Sub
-
- 'textboxs de la frame1
-
- Private Sub Text1_Click()
- If Text1.Text = "Titre" Then
- Text1.Text = ""
- End If
- End Sub
- Private Sub Text1_gotfocus()
- Call Text1_Click
- End Sub
- Private Sub Text2_Click()
- If Text2.Text = "Ligne 1" Then
- Text2.Text = ""
- End If
- End Sub
- Private Sub Text2_gotfocus()
- Call Text2_Click
- End Sub
- Private Sub Text3_Click()
- If Text3.Text = "Ligne 2" Then
- Text3.Text = ""
- End If
- End Sub
- Private Sub Text3_gotfocus()
- Call Text3_Click
- End Sub
- Private Sub Text4_Click()
- If Text4.Text = "Ligne 3" Then
- Text4.Text = ""
- End If
- End Sub
- Private Sub Text4_gotfocus()
- Call Text4_Click
- End Sub
- Private Sub Text5_Click()
- If Text5.Text = "Ligne 4" Then
- Text5.Text = ""
- End If
- End Sub
- Private Sub Text5_gotfocus()
- Call Text5_Click
- End Sub
- Private Sub Text6_Click()
- If Text6.Text = "Ligne 5" Then
- Text6.Text = ""
- End If
- End Sub
- Private Sub Text6_gotfocus()
- Call Text6_Click
- End Sub
- Private Sub Text1_LostFocus()
- If Text1.Text = "" Then
- Text1.Text = "Titre"
- End If
- End Sub
- Private Sub Text2_LostFocus()
- If Text2.Text = "" Then
- Text2.Text = "Ligne 1"
- End If
- End Sub
- Private Sub Text3_LostFocus()
- If Text3.Text = "" Then
- Text3.Text = "Ligne 2"
- End If
- End Sub
- Private Sub Text4_LostFocus()
- If Text4.Text = "" Then
- Text4.Text = "Ligne 3"
- End If
- End Sub
- Private Sub Text5_LostFocus()
- If Text5.Text = "" Then
- Text5.Text = "Ligne 4"
- End If
- End Sub
- Private Sub Text6_LostFocus()
- If Text6.Text = "" Then
- Text6.Text = "Ligne 5"
- End If
- End Sub
-
- 'textboxs de la frame2 (non exploitée !)
-
- Private Sub Text7_Click()
- If Text7.Text = "Titre" Then
- Text7.Text = ""
- End If
- End Sub
- Private Sub Text7_gotfocus()
- Call Text7_Click
- End Sub
- Private Sub Text8_Click()
- If Text8.Text = "Ligne 1" Then
- Text8.Text = ""
- End If
- End Sub
- Private Sub Text8_gotfocus()
- Call Text8_Click
- End Sub
- Private Sub Text9_Click()
- If Text9.Text = "Ligne 2" Then
- Text9.Text = ""
- End If
- End Sub
- Private Sub Text9_gotfocus()
- Call Text9_Click
- End Sub
- Private Sub Text10_Click()
- If Text10.Text = "Ligne 3" Then
- Text10.Text = ""
- End If
- End Sub
- Private Sub Text10_gotfocus()
- Call Text10_Click
- End Sub
- Private Sub Text11_Click()
- If Text11.Text = "Ligne 4" Then
- Text11.Text = ""
- End If
- End Sub
- Private Sub Text11_gotfocus()
- Call Text11_Click
- End Sub
- Private Sub Text12_Click()
- If Text12.Text = "Ligne 5" Then
- Text12.Text = ""
- End If
- End Sub
- Private Sub Text12_gotfocus()
- Call Text12_Click
- End Sub
- Private Sub Text7_LostFocus()
- If Text7.Text = "" Then
- Text7.Text = "Titre"
- End If
- End Sub
- Private Sub Text8_LostFocus()
- If Text8.Text = "" Then
- Text8.Text = "Ligne 1"
- End If
- End Sub
- Private Sub Text9_LostFocus()
- If Text9.Text = "" Then
- Text9.Text = "Ligne 2"
- End If
- End Sub
- Private Sub Text10_LostFocus()
- If Text10.Text = "" Then
- Text10.Text = "Ligne 3"
- End If
- End Sub
- Private Sub Text11_LostFocus()
- If Text11.Text = "" Then
- Text11.Text = "Ligne 4"
- End If
- End Sub
- Private Sub Text12_LostFocus()
- If Text12.Text = "" Then
- Text12.Text = "Ligne 5"
- End If
- End Sub
-
Option Explicit
Dim v1, v2, v3, v4, v5, Title1, Picture1, Buton, v6, v7, v8, v9, v10, Title2, Pictur2, M As Integer
Private Sub Check1_Click()
If Check1.Value = 1 Then
Check1.Caption = "Beep On"
ElseIf Check1.Value = 0 Then
Check1.Caption = "Beep Off"
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Check2.Caption = "Masquer On"
ElseIf Check1.Value = 0 Then
Check2.Caption = "Masquer Off"
End If
End Sub
Private Sub form_load()
Option1(0).Value = True
Option3(2).Value = True
Option2(0).Value = True
End Sub
Private Sub Form_unload(cancel As Integer)
End
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
'generation de la msgbox
Private Sub Command1_Click()
If Option1(0).Value = True Then
Picture1 = vbQuestion
End If
If Option1(1).Value = True Then
Picture1 = vbInformation
End If
If Option1(2).Value = True Then
Picture1 = vbExclamation
End If
If Option1(3).Value = True Then
Picture1 = vbCritical
End If
If Option3(0).Value = True Then
Buton = vbYesNo
End If
If Option3(1).Value = True Then
Buton = vbYesNoCancel
End If
If Option3(2).Value = True Then
Buton = vbOKOnly
End If
If Option3(3).Value = True Then
Buton = vbOKCancel
End If
If Option3(5).Value = True Then
Buton = vbRetryCancel
End If
If Option3(6).Value = True Then
Buton = vbAbortRetryIgnore
End If
If Not Text1.Text = "" Then
Title1 = Text1.Text
End If
If Not Text2.Text = "" Then
v1 = Text2.Text & Chr(10)
ElseIf Text2.Text = "Ligne 1" Then
v1 = ""
Else
Resume Next
End If
If Not Text3.Text = "" Then
v2 = Text3.Text & Chr(10)
ElseIf Text3.Text = "Ligne 2" Then
v2 = ""
Else
Resume Next
End If
If Not Text4.Text = "" Then
v3 = Text4.Text & Chr(10)
ElseIf Text4.Text = "Ligne 3" Then
v3 = ""
Else
Resume Next
End If
If Not Text5.Text = "" Then
v4 = Text5.Text & Chr(10)
ElseIf Text5.Text = "Ligne 4" Then
v4 = ""
Else
Resume Next
End If
If Not Text6.Text = "" Then
v5 = Text6.Text
ElseIf Text6.Text = "Ligne 5" Then
v5 = ""
Else
Resume Next
End If
If Not Text1.Text = "" Then
If Not Text1.Text = "Titre" Then
If Not Text2.Text = "Ligne 1" Then
If Not Text3.Text = "Ligne 2" Then
If Not Text4.Text = "Ligne 3" Then
If Not Text5.Text = "Ligne 4" Then
If Not Text6.Text = "Ligne 5" Then
msg0:
Call mask
Call bep
M = MsgBox(v1 & v2 & v3 & v4 & v5, Buton + Picture1, Title1)
If M = vbRetry Then
GoTo msg0
End If
Me.Visible = True
Exit Sub
End If
msg1:
Call mask
Call bep
M = MsgBox(v1 & v2 & v3 & v4, Buton + Picture1, Title1)
If M = vbRetry Then
GoTo msg1
End If
Me.Visible = True
Exit Sub
End If
msg2:
Call mask
Call bep
M = MsgBox(v1 & v2 & v3, Buton + Picture1, Title1)
If M = vbRetry Then
GoTo msg2
End If
Me.Visible = True
Exit Sub
End If
msg3:
Call mask
Call bep
M = MsgBox(v1 & v2, Buton + Picture1, Title1)
If M = vbRetry Then
GoTo msg3
End If
Me.Visible = True
Exit Sub
End If
msg4:
Call mask
Call bep
M = MsgBox(v1, Buton + Picture1, Title1)
Me.Visible = True
If M = vbRetry Then
GoTo msg4
End If
Exit Sub
End If
Me.Visible = True
MsgBox "Vous devez paramètrer le reste de la boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
Me.Visible = True
Exit Sub
Else
Me.Visible = True
MsgBox "Vous devez ecrire un titre pour votre boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
Me.Visible = True
Exit Sub
End If
Me.Visible = True
MsgBox "Vous devez paramètrer une boite de dialogue !!", vbOKOnly + vbCritical, "Attention"
Me.Visible = True
Exit Sub
End If
End Sub
Private Sub mask()
If Check2.Value = 1 Then
Me.Visible = False
ElseIf Check1.Value = 2 Then
Me.Visible = True
End If
End Sub
Private Sub bep()
If Check1.Value = 1 Then
Beep
Beep
Beep
End If
End Sub
'textboxs de la frame1
Private Sub Text1_Click()
If Text1.Text = "Titre" Then
Text1.Text = ""
End If
End Sub
Private Sub Text1_gotfocus()
Call Text1_Click
End Sub
Private Sub Text2_Click()
If Text2.Text = "Ligne 1" Then
Text2.Text = ""
End If
End Sub
Private Sub Text2_gotfocus()
Call Text2_Click
End Sub
Private Sub Text3_Click()
If Text3.Text = "Ligne 2" Then
Text3.Text = ""
End If
End Sub
Private Sub Text3_gotfocus()
Call Text3_Click
End Sub
Private Sub Text4_Click()
If Text4.Text = "Ligne 3" Then
Text4.Text = ""
End If
End Sub
Private Sub Text4_gotfocus()
Call Text4_Click
End Sub
Private Sub Text5_Click()
If Text5.Text = "Ligne 4" Then
Text5.Text = ""
End If
End Sub
Private Sub Text5_gotfocus()
Call Text5_Click
End Sub
Private Sub Text6_Click()
If Text6.Text = "Ligne 5" Then
Text6.Text = ""
End If
End Sub
Private Sub Text6_gotfocus()
Call Text6_Click
End Sub
Private Sub Text1_LostFocus()
If Text1.Text = "" Then
Text1.Text = "Titre"
End If
End Sub
Private Sub Text2_LostFocus()
If Text2.Text = "" Then
Text2.Text = "Ligne 1"
End If
End Sub
Private Sub Text3_LostFocus()
If Text3.Text = "" Then
Text3.Text = "Ligne 2"
End If
End Sub
Private Sub Text4_LostFocus()
If Text4.Text = "" Then
Text4.Text = "Ligne 3"
End If
End Sub
Private Sub Text5_LostFocus()
If Text5.Text = "" Then
Text5.Text = "Ligne 4"
End If
End Sub
Private Sub Text6_LostFocus()
If Text6.Text = "" Then
Text6.Text = "Ligne 5"
End If
End Sub
'textboxs de la frame2 (non exploitée !)
Private Sub Text7_Click()
If Text7.Text = "Titre" Then
Text7.Text = ""
End If
End Sub
Private Sub Text7_gotfocus()
Call Text7_Click
End Sub
Private Sub Text8_Click()
If Text8.Text = "Ligne 1" Then
Text8.Text = ""
End If
End Sub
Private Sub Text8_gotfocus()
Call Text8_Click
End Sub
Private Sub Text9_Click()
If Text9.Text = "Ligne 2" Then
Text9.Text = ""
End If
End Sub
Private Sub Text9_gotfocus()
Call Text9_Click
End Sub
Private Sub Text10_Click()
If Text10.Text = "Ligne 3" Then
Text10.Text = ""
End If
End Sub
Private Sub Text10_gotfocus()
Call Text10_Click
End Sub
Private Sub Text11_Click()
If Text11.Text = "Ligne 4" Then
Text11.Text = ""
End If
End Sub
Private Sub Text11_gotfocus()
Call Text11_Click
End Sub
Private Sub Text12_Click()
If Text12.Text = "Ligne 5" Then
Text12.Text = ""
End If
End Sub
Private Sub Text12_gotfocus()
Call Text12_Click
End Sub
Private Sub Text7_LostFocus()
If Text7.Text = "" Then
Text7.Text = "Titre"
End If
End Sub
Private Sub Text8_LostFocus()
If Text8.Text = "" Then
Text8.Text = "Ligne 1"
End If
End Sub
Private Sub Text9_LostFocus()
If Text9.Text = "" Then
Text9.Text = "Ligne 2"
End If
End Sub
Private Sub Text10_LostFocus()
If Text10.Text = "" Then
Text10.Text = "Ligne 3"
End If
End Sub
Private Sub Text11_LostFocus()
If Text11.Text = "" Then
Text11.Text = "Ligne 4"
End If
End Sub
Private Sub Text12_LostFocus()
If Text12.Text = "" Then
Text12.Text = "Ligne 5"
End If
End Sub
Conclusion
Bon si vous voulez pas le zip voici la liste des controles : 6 Textes boxs 4 images 2 bouton 2 frames 2 Checkboxs 2 groupes d'options (un de 4 et l'aute de 6) et voila ! sinon tout est dans le zip !
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Message Box [ par xavier77 ]
Salut, J'en ait un peu marre du MsgBox de VB, alors, j'ai donc décidé d'en créer un avec des nouvelles propriétés (couleur, des nouveau icones,...).J'
Comment afficher plusieur message box ? [ par Mrx3 ]
... compatible vbscript . Quand je metMsgBox "texte1", ,"titre1"MsgBox "texte2", ,"titre2"Sa m'ouvre la première boite et apres la deuxieme, comment f
Message Box non bloquante [ par Sapaya ]
Voila, je voudrais savoir si c'est possible de faire une msgbox non bloquante.En bref, que le code situé apres l'appel de cet msgbox soit executé meme
msgBox personnalisée [ par mickael3905 ]
Bonjour,J'aimerais savoir s'il est possible de programmer une message box personnalisée.Cette message box aurait 2 boutons sur lesquels serait re
message box [ par nana10 ]
bonjour premierement bonne féte à tous les péres!!!!mon probléme c'est que je veux programmer en vb6un msgbox sous forme de combobox c'est à dire qu
[vb.net]Message box oui/non [ par sisi35 ]
Bonjour, Je voudrais avoir 2 boutons dans ma message box: "oui" et "non" et non pas "yes" et "no".Comment faire?Merci, Sylvie.
lire le contenu d'un message box [ par CrazyMan19 ]
salut tt le mondeje vx un bout d code qui me permitteras de lire le contenu d'un message box affiché par une application , et merçi :)Je suis né intel
Envoyer un message distant [ par culie3 ]
Bonjour, voila je voudrais avoir de l'aide pour savoir comment envoyer un message distant c'est à dire:Il y a 2 fichiers:-Le controle(sur votre ordi)-
Probleme de msgbox [ par zizouth ]
Salut,J'ai remarqué que lors qu'un affichage d'une msgbox le programme se met en pause jusqu'a qu'on appuis sur le buton ok (ou yes, no etc..) de la
Envoyer une message box via winsock [ par alex_sex ]
Be je pence que le titre est explicatif Enfin voila je cherche a envoyer une msgbox au serveur, comment j'pourais faire ca? Merci :)
|
Derniers Blogs
OFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONSOFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONS par junarnoalg
De nombreuses entreprises font le choix de SharePoint Online, service fourni au travers de l'offre de Microsoft Office 365. S'il est vrai que ce choix apporte un grand nombre d'avantages; rapidité de mise en ½uvre, disponibilité, large couvertu...
Cliquez pour lire la suite de l'article par junarnoalg PRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGEPRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGE par richardc
http://www.c2idotnet.com/articles/presentation-des-api-rest-de-windows-azure-lister-les-comptes-de-storage
Désolé pour "toto", mais c2i existait avant blogs.developpeur.org et c'est mon site "officiel" ;-) ...
Cliquez pour lire la suite de l'article par richardc [HTML5] SLIDES ET DéMOS : AUTOUR DU W3C , NOUVEAUX STANDARDS ET WEB MOBILE (LILLE)[HTML5] SLIDES ET DéMOS : AUTOUR DU W3C , NOUVEAUX STANDARDS ET WEB MOBILE (LILLE) par Gio
Très bonne après-midi passée lors cette conférence avec le W3C, organisée par L' Inria sur les nouveaux standards, ce Mardi 14 Février, on sent vraiment que çà bosse au W3C, et l'avenir est très très prometteur pour le HTML5, notamment ...
Cliquez pour lire la suite de l'article par Gio GESTION D'EXCEPTION AVEC LES TASKSGESTION D'EXCEPTION AVEC LES TASKS par richardc
Nous avons vu dans un précédent article comment utiliser Task pour effectuer des opérations dans un autre thread.
Malheureusement, comme tout le monde n'est pas parfait, il se peut que cette exécution se passe mal et qu'une exception se produise.
La...
Cliquez pour lire la suite de l'article par richardc
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|