Galvanometre(ou vu metre voire progressbar differente)

Description

prex aussitot mis a jour, deja !!! tout le monde connait le principe du vu-metre a aiguille, c donc ce que j'ai créé
plusieurs evenements programmés et programmable dont surtout le taux de rafraichissement(via .ctl seulement vu que j'ai toujours pas trouvé le moyen de controler interval timer via un projet quelconque...)
ce n'est que mon 2nd activeX, soyez gentils, ou essayez, ça me motivera...
et les conseils sont toujours les bienvenus...
merci d'avance.

Source / Exemple :


'suite a  premier remarque,le zip contient desormais un nouveau projet le
 'code utilisant un api pour la copie n'est pas de moi, mais j'ai fait au plus
 'vite  PS: une fois le projet chargé, appeler l'ocx via "composants" dans le 
'dossier njck671galva------------je ne l'ai pas rajoutée dans le
 'dossier 'copyfolder' au vu de sa taille 304ko...
'voyez si vous pouvez en faire autre chose qu'un pese personne !

'******************************************************
' petite aide --------------------------------------------------------------
'dans un projet, simple ou non, la commande se fait par le biais 
'evenements et de la valeur ---pourcentactif--- qui est un nombre entier de 
' 1 a 100 de preference
'***********************POUR EXEMPLE********************
Private Sub Command1_Click()
Galva11.pourcentactif = 25
End Sub
Private Sub Command2_Click()
Galva11.pourcentactif = 58
End Sub

Private Sub Galva11_LightOfF()
Galva11.pourcentactif = 35
End Sub
'*******************************************************
'voir les evenements ci dessous
'SI quelqu un peux m'aider a controler l'interval du timer * en projet !! *merci
'd avance----------------------------------------------------------------------------

Event LightOn()
Event LightOfF()
Event FullScalE()
Event MidScalE()
Event MinScalE()

'Backlight_on
Private Sub Image2_Click()
    Image3.Visible = True
    Image4.Enabled = True
    Image1.Visible = False
    Image2.Enabled = False
    RaiseEvent LightOn
End Sub

'backlight_off
Private Sub image4_click()
    Image1.Visible = True
    Image2.Enabled = True
    Image3.Visible = False
    Image4.Enabled = False
    RaiseEvent LightOfF
End Sub

'******************************************************

Public Property Get pourcentactif() As Integer
    pourcentactif = Label1.Caption
End Property

Public Property Get RefreshTime() As Integer
    RefreshTime = Label2.Caption
    
End Property

'inscription du champ propriété*************************

Public Property Let pourcentactif(ByVal new_pourcent As Integer)
    Label1.Caption() = new_pourcent
    PropertyChanged "pourcentactif"
End Property

'inscription du champ propriété time********************
Public Property Let RefreshTime(ByVal new_time As Integer)
    Label2.Caption() = new_time
    PropertyChanged "RefreshTime"
End Property

Private Sub Timer1_Timer()

' evenement pleine gamme ------------------------------
    If Label1.Caption = 100 Then
        RaiseEvent FullScalE
    End If
' evenement gamme moyenne -----------------------------
    If Label1.Caption = 50 Then
        RaiseEvent MidScalE
    End If
' evenement gamme minimum -----------------------------
    If Label1.Caption = 1 Then
        RaiseEvent MinScalE
    End If
'Line position*****************************************
    If Label1.Caption <= 50 Then
        Line1.X1 = (Label1.Caption * 21.6) + 600
       Line1.Y1 = 1200 - (Label1.Caption * 8.4)
    End If
    
    If Label1.Caption >= 51 Then
        Line1.X1 = (Label1.Caption * 21.6) + 600
        Line1.Y1 = 520 + (Label1.Caption * 7.2)
    End If

End Sub

Private Sub UserControl_Initialize()
    Image1.Visible = True
    Image2.Enabled = True
    Image3.Visible = False
    Image4.Enabled = False
    Label1.Caption = 1
    Timer1.Enabled = True
End Sub

'lecture des propriétés
Private Sub usercontrol_readproperties(prop As PropertyBag)
    On Error Resume Next
        If Timer1.Enabled = True Then
            Label1.Caption = prop.ReadProperty("pourcentactif", "label1")
            Label2.Caption = prop.ReadProperty("RefreshTime", "label2")
        End If
End Sub

'enregistrement des propriétés
Private Sub usercontrol_writeproperties(prop As PropertyBag)
On Error Resume Next
Call prop.WriteProperty("pourcentactif", Label1.Caption, "label1")
Call prop.WriteProperty("RefreshTime", Label2.Caption, "label2")
End Sub

Conclusion :


apercu des ce soir

Codes Sources

A voir également

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.