Soyez le premier à donner votre avis sur cette source.
Snippet vu 3 822 fois - Téléchargée 3 fois
Sub chargement_options(options_demarrage() As String) Dim sz(0) As String For u = 0 To options_demarrage.Count - 1 If options_demarrage(u) IsNot Nothing Then sz = options_demarrage(u).Split(";") If sz IsNot Nothing Then Call mettre_a_jour_le_control_au_demarrage(sz(0), sz(1)) End If End If Next Application.DoEvents() End Sub Sub mettre_a_jour_le_control_au_demarrage(nom As String, text As String) For Each c1 In Controls If c1.name.ToString = nom Then type_de_control(c1, text) End If For Each c2 In c1.Controls If c2.name.ToString = nom Then type_de_control(c2, text) End If For Each c3 In c2.Controls If c3.name.ToString = nom Then type_de_control(c3, text) End If For Each c4 In c3.Controls If c4.name.ToString = nom Then type_de_control(c4, text) End If For Each c5 In c4.Controls If c5.name.ToString = nom Then type_de_control(c5, text) End If For Each c6 In c5.Controls If c6.name.ToString = nom Then type_de_control(c6, text) End If For Each c7 In c6.Controls If c7.name.ToString = nom Then type_de_control(c7, text) End If For Each c8 In c7.Controls If c8.name.ToString = nom Then type_de_control(c8, text) End If Next Next Next Next Next Next Next Next End Sub Sub type_de_control(ByRef co_, ByVal text_) If TypeOf co_ Is Label Then co_.text = text_ End If If TypeOf co_ Is ComboBox Then co_.selecteditem = text_ End If If TypeOf co_ Is CheckBox Then If text_ = "True" Then co_.checked = True Else co_.checked = False End If End If If TypeOf co_ Is RadioButton Then If text_ = "True" Then co_.checked = True Else co_.checked = False End If End If End Sub Function mettre_a_jour_les_options_a_la_sauvegarde() 'TOUS LES CONTROLES QUI ONT LE CHIFFRE 1 DANS LEUR TAG 'SERONT ENREGISTRES Dim sz(10000) As String Dim nz As Integer = 0 For Each c1 In Me.Controls If c1.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c1) End If For Each c2 In c1.Controls If c2.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c2) End If For Each c3 In c2.Controls If c3.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c3) End If For Each c4 In c3.Controls If c4.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c4) End If For Each c5 In c4.Controls If c5.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c5) End If For Each c6 In c5.Controls If c6.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c6) End If For Each c7 In c6.Controls If c7.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c7) End If For Each c8 In c7.Controls If c8.tag = "1" Then nz = nz + 1 sz(nz) = retourner_la_valeur_du_control(c8) End If Next Next Next Next Next Next Next Next If nz > 0 Then ReDim Preserve sz(nz) If sz IsNot Nothing Then Return sz End If Else End If End Function Function retourner_la_valeur_du_control(ByVal co_) If TypeOf co_ Is Label Then Return co_.name & ";" & co_.text End If If TypeOf co_ Is ComboBox Then If co_.selectedindex > -1 Then Return co_.name & ";" & co_.selecteditem.ToString End If If TypeOf co_ Is CheckBox Then Return co_.name & ";" & co_.checked.ToString End If If TypeOf co_ Is RadioButton Then Return co_.name & ";" & co_.checked.ToString End If End Function
28 avril 2019 à 12:13
Va voir ici : https://codes-sources.commentcamarche.net/forum/affich-10095533-un-phenomeme-bizarre#newanswer
J'en ai remis une couche !
Pour info Visual Studio Community 2019 est disponible : je l'ai installé
bon week-end à toi et ta petite famille
28 avril 2019 à 11:58
En plus impossible de déterminer de quel VB il s'agit
le préciser sera indispensable
28 avril 2019 à 11:49
Pour poster du code voir ceci : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
Merci
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.