user control

Dim VT1 As String
Dim VT2 As String
Dim VL1 As String
Dim VL2 As String
Dim VC1 As String
Dim VC2 As String
Public Event ASCIITEXTO1(nro As Integer)
Public Event ASCIITEXTO2(nro As Integer)
Public Event LARGOTEXTO1(LARGO As Integer)
Public Event LARGOTEXTO2(LARGO As Integer)
Sub tamaxo()
  If UserControl.Height < 2000 Then UserControl.Height = 2000
  If UserControl.Width < 3000 Then UserControl.Width = 3000
    Label1.Top = 600 / 3000 * UserControl.Height
    Label2.Top = 1380 / 3000 * UserControl.Height
    Label1.Left = 240 / 5000 * UserControl.Width
    Label2.Left = 240 / 5000 * UserControl.Width
    Label1.Height = 400 / 3000 * UserControl.Height
    Label2.Height = 400 / 3000 * UserControl.Height
    Label1.Width = 1500 / 5000 * UserControl.Width
    Label2.Width = 1500 / 5000 * UserControl.Width
    
    Text1.Top = 600 / 3000 * UserControl.Height
    Text2.Top = 1380 / 3000 * UserControl.Height
    Text1.Left = 1980 / 5000 * UserControl.Width
    Text2.Left = 1980 / 5000 * UserControl.Width
    Text1.Height = 400 / 3000 * UserControl.Height
    Text2.Height = 400 / 3000 * UserControl.Height
    Text1.Width = 2500 / 5000 * UserControl.Width
    Text2.Width = 2500 / 5000 * UserControl.Width
    
    Command1.Top = 2280 / 3000 * UserControl.Height
    Command2.Top = 2280 / 3000 * UserControl.Height
    Command1.Left = 210 / 5000 * UserControl.Width
    Command2.Left = 2280 / 5000 * UserControl.Width
    Command1.Height = 400 / 3000 * UserControl.Height
    Command2.Height = 400 / 3000 * UserControl.Height
    Command1.Width = 1600 / 5000 * UserControl.Width
    Command2.Width = 1600 / 5000 * UserControl.Width

End Sub
Sub LIMPIA1()
    Text1 = ""
End Sub
Sub LIMPIA2()
    Text2 = ""
End Sub
Property Get AT1() As String
    AT1 = VT1
    Text1 = VT1
End Property
Property Let AT1(X As String)
    VT1 = X
    PropertyChanged AT1
End Property
Property Get AT2() As String
    AT2 = VT2
    Text2 = VT2
End Property
Property Let AT2(X As String)
    VT2 = X
    PropertyChanged AT2
End Property
Property Get AL1() As String
    AL1 = VL1
    Label1 = VL1
End Property
Property Let AL1(X As String)
    VL1 = X
    PropertyChanged AL1
End Property

Property Get AL2() As String
    AL2 = VL2
    Label2 = VL2
End Property
Property Let AL2(X As String)
    VL2 = X
    PropertyChanged AL2
End Property
Property Get AC1() As String
    AC1 = VC1
    Command1.Caption = VC1
End Property
Property Let AC1(X As String)
    VC1 = X
    PropertyChanged AC1
End Property
Property Get AC2() As String
    AC2 = VC2
    Command2.Caption = VC2
End Property
Property Let AC2(X As String)
    VC2 = X
    PropertyChanged AC2
End Property


Private Sub Text1_Change()
    RaiseEvent LARGOTEXTO1(Len(Text1))
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    RaiseEvent ASCIITEXTO1(KeyAscii)
End Sub


Private Sub Text2_Change()
    RaiseEvent LARGOTEXTO2(Len(Text2))
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    RaiseEvent ASCIITEXTO2(KeyAscii)
End Sub

Private Sub UserControl_Initialize()
    Call tamaxo
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    AL1 = PropBag.ReadProperty("AL1", "")
    AL2 = PropBag.ReadProperty("AL2", "")
    AT1 = PropBag.ReadProperty("AT1", "")
    AT2 = PropBag.ReadProperty("AT2", "")
    AC1 = PropBag.ReadProperty("AC1", "")
    AC2 = PropBag.ReadProperty("AC2", "")
End Sub

Private Sub UserControl_Resize()
    Call tamaxo
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    Call PropBag.WriteProperty("AL1", VL1, "")
    Call PropBag.WriteProperty("AL2", VL2, "")
    Call PropBag.WriteProperty("AT1", VT1, "")
    Call PropBag.WriteProperty("AT2", VT2, "")
    Call PropBag.WriteProperty("AC1", VC1, "")
    Call PropBag.WriteProperty("AC2", VC2, "")
    
    
End Sub




Form


Private Sub Command1_Click()
    UserControl11.LIMPIA1
    UserControl11.LIMPIA2
End Sub

Private Sub UserControl11_ASCIITEXTO1(nro As Integer)
    Label1.Caption = nro
End Sub

Private Sub UserControl11_ASCIITEXTO2(nro As Integer)
    Label2.Caption = nro
End Sub

Private Sub UserControl11_LARGOTEXTO1(LARGO As Integer)
    Label3.Caption = LARGO
End Sub

Private Sub UserControl11_LARGOTEXTO2(LARGO As Integer)
    Label4.Caption = LARGO

End Sub
Make your own free website on Tripod.com