PREMIER ACTIVE X, soyez indulgents
tout dans le zip y compris l'ocx
je vais continuer a le modifier, les conseils sont les bien venus....
Source / Exemple :
'mise a jour suite a remarque de : Rrominet déposé le 18/09/2003 13:28:25
Event click()
Event ClickIteM1()
Event ClickIteM2()
Event ClickIteM3()
Event ClickIteM4()
Event ClickIteM5()
Event ClickIteM6()
'evenement click
Private Sub click()
RaiseEvent click
End Sub
'pour text
Public Property Get text() As String
text = Text1.text
End Property
'inscription du champ propriete text
Public Property Let text(ByVal new_text As String)
Text1.text() = new_text
PropertyChanged "text"
End Property
'pour item1
Public Property Get item1() As String
item1 = Label1.Caption
End Property
'inscription du champ propriete item1
Public Property Let item1(ByVal new_item1 As String)
Label1.Caption() = new_item1
PropertyChanged "item1"
End Property
'pour item2
Public Property Get item2() As String
item2 = Label2.Caption
End Property
'inscription du champ propriete item2
Public Property Let item2(ByVal new_item2 As String)
Label2.Caption() = new_item2
PropertyChanged "item2"
End Property
'pour item3
Public Property Get item3() As String
item3 = Label3.Caption
End Property
'inscription du champ propriete item3
Public Property Let item3(ByVal new_item3 As String)
Label3.Caption() = new_item3
PropertyChanged "item3"
End Property
'pour item4
Public Property Get item4() As String
item4 = Label4.Caption
End Property
'inscription du champ propriete item4
Public Property Let item4(ByVal new_item4 As String)
Label4.Caption() = new_item4
PropertyChanged "item4"
End Property
'pour item5
Public Property Get item5() As String
item5 = Label5.Caption
End Property
'inscription du champ propriete item5
Public Property Let item5(ByVal new_item5 As String)
Label5.Caption() = new_item5
PropertyChanged "item5"
End Property
'pour item6
Public Property Get item6() As String
item6 = Label6.Caption
End Property
'inscription du champ propriete item6
Public Property Let item6(ByVal new_item6 As String)
Label6.Caption() = new_item6
PropertyChanged "item6"
End Property
'*** SURLIGNAGE DES LABELS *** et *** EVENEMENT CLICK()*******************
Private Sub label1_click()
Label1.BackColor = &HFFC0C0
Label2.BackColor = &HFFFFFF
Label3.BackColor = &HFFFFFF
Label4.BackColor = &HFFFFFF
Label5.BackColor = &HFFFFFF
Label6.BackColor = &HFFFFFF
RaiseEvent ClickIteM1
Text1.text = Label1.Caption
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
Private Sub Label2_click()
Label1.BackColor = &HFFFFFF
Label2.BackColor = &HFFC0C0
Label3.BackColor = &HFFFFFF
Label4.BackColor = &HFFFFFF
Label5.BackColor = &HFFFFFF
Label6.BackColor = &HFFFFFF
RaiseEvent ClickIteM2
Text1.text = Label2.Caption
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
Private Sub Label3_click()
Label1.BackColor = &HFFFFFF
Label2.BackColor = &HFFFFFF
Label3.BackColor = &HFFC0C0
Label4.BackColor = &HFFFFFF
Label5.BackColor = &HFFFFFF
Label6.BackColor = &HFFFFFF
RaiseEvent ClickIteM3
Text1.text = Label3.Caption
Shape2.Visible = False
Image1.Enabled = False
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
End Sub
Private Sub Label4_click()
Label1.BackColor = &HFFFFFF
Label2.BackColor = &HFFFFFF
Label3.BackColor = &HFFFFFF
Label4.BackColor = &HFFC0C0
Label5.BackColor = &HFFFFFF
Label6.BackColor = &HFFFFFF
RaiseEvent ClickIteM4
Text1.text = Label4.Caption
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
Private Sub Label5_click()
Label1.BackColor = &HFFFFFF
Label2.BackColor = &HFFFFFF
Label3.BackColor = &HFFFFFF
Label4.BackColor = &HFFFFFF
Label5.BackColor = &HFFC0C0
Label6.BackColor = &HFFFFFF
RaiseEvent ClickIteM5
Text1.text = Label5.Caption
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
Private Sub Label6_click()
Label1.BackColor = &HFFFFFF
Label2.BackColor = &HFFFFFF
Label3.BackColor = &HFFFFFF
Label4.BackColor = &HFFFFFF
Label5.BackColor = &HFFFFFF
Label6.BackColor = &HFFC0C0
RaiseEvent ClickIteM6
Text1.text = Label6.Caption
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
'lecture des propriétés
Private Sub usercontrol_readproperties(prop As PropertyBag)
On Error Resume Next
Text1.text = prop.ReadProperty("text", "text1")
Label1.Caption = prop.ReadProperty("item1", "label1")
Label2.Caption = prop.ReadProperty("item2", "label2")
Label3.Caption = prop.ReadProperty("item3", "label3")
Label4.Caption = prop.ReadProperty("item4", "label4")
Label5.Caption = prop.ReadProperty("item5", "label5")
Label6.Caption = prop.ReadProperty("item6", "label6")
End Sub
'enregistrement des propriétés
Private Sub usercontrol_writeproperties(prop As PropertyBag)
On Error Resume Next
Call prop.WriteProperty("text", Text1.text, "text1")
Call prop.WriteProperty("item1", Label1.Caption, "label1")
Call prop.WriteProperty("item2", Label2.Caption, "label2")
Call prop.WriteProperty("item3", Label3.Caption, "label3")
Call prop.WriteProperty("item4", Label4.Caption, "label4")
Call prop.WriteProperty("item5", Label5.Caption, "label5")
Call prop.WriteProperty("item6", Label6.Caption, "label6")
End Sub
'pour ouvrir la fenetre
Private Sub Bouton1_Click()
Shape2.Visible = True
Image1.Enabled = True
For i = 1 To 6
Label(i).Visible = True
Next i
End Sub
'pour fermer la fenetre
Private Sub Image1_Click()
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
End Sub
'initialisation du contrôle
Private Sub UserControl_Initialize()
Shape2.Visible = False
Image1.Enabled = False
For i = 1 To 6
Label(i).Visible = False
Next i
Text1.text = "NjcK671 FX-Capabilities"
End Sub
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.