VERSION 5.00
Begin VB.UserControl ctrl_stockb 
   ClientHeight    =   375
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   11325
   ScaleHeight     =   375
   ScaleWidth      =   11325
   Begin VB.TextBox ctrl_fisico 
      Alignment       =   1  'Right Justify
      Height          =   375
      Left            =   9720
      MaxLength       =   11
      TabIndex        =   4
      Top             =   0
      Width           =   1575
   End
   Begin VB.TextBox txt_descr 
      BackColor       =   &H00FFFFC0&
      Enabled         =   0   'False
      Height          =   375
      Left            =   6000
      TabIndex        =   3
      TabStop         =   0   'False
      Top             =   0
      Width           =   3735
   End
   Begin VB.TextBox txt_idprod 
      BackColor       =   &H00FFFFC0&
      Enabled         =   0   'False
      Height          =   375
      Left            =   4200
      TabIndex        =   2
      TabStop         =   0   'False
      Top             =   0
      Width           =   1815
   End
   Begin VB.TextBox txt_nscat 
      BackColor       =   &H00FFFFC0&
      Enabled         =   0   'False
      Height          =   375
      Left            =   1680
      TabIndex        =   1
      TabStop         =   0   'False
      Top             =   0
      Width           =   2535
   End
   Begin VB.TextBox txt_ncat 
      BackColor       =   &H00FFFFC0&
      Enabled         =   0   'False
      Height          =   375
      Left            =   0
      TabIndex        =   0
      TabStop         =   0   'False
      Top             =   0
      Width           =   1695
   End
End
Attribute VB_Name = "ctrl_stockb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Public Property Get ncat() As String
Attribute ncat.VB_MemberFlags = "14"
ncat = txt_ncat.Text
End Property
Public Property Get nscat() As String
Attribute nscat.VB_MemberFlags = "14"
nscat = txt_nscat.Text
End Property
Public Property Get idprod() As String
Attribute idprod.VB_MemberFlags = "14"
idprod = txt_idprod.Text
End Property
Public Property Get descr() As String
Attribute descr.VB_MemberFlags = "14"
descr = txt_descr.Text
End Property
Public Property Get fisico() As String
Attribute fisico.VB_MemberFlags = "14"
fisico = ctrl_fisico.Text
End Property
Public Property Let ncat(ByVal newncat As String)
txt_ncat.Text = newncat
End Property
Public Property Let nscat(ByVal newnscat As String)
txt_nscat.Text = newnscat
End Property
Public Property Let idprod(ByVal newidprod As String)
txt_idprod.Text = newidprod
End Property
Public Property Let descr(ByVal newdescr As String)
txt_descr.Text = newdescr
End Property
Public Property Let fisico(ByVal newfisico As String)
ctrl_fisico.Text = newfisico
End Property

Private Sub ctrl_fisico_GotFocus()
ctrl_fisico.BackColor = vbCyan
ctrl_fisico.SelStart = 0
ctrl_fisico.SelLength = Len(ctrl_fisico.Text)
End Sub
Private Sub ctrl_fisico_KeyPress(KeyAscii As Integer)

If ((KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or _
    Chr(KeyAscii) = "." Or _
    KeyAscii = vbKeyClear Or _
    KeyAscii = vbKeyTab Or _
    KeyAscii = vbKeyBack) And _
    (Chr(KeyAscii) = "." And InStr(ctrl_fisico.Text, ".")) = 0 Then
    
    If Len(ctrl_fisico) >= 7 And InStr(ctrl_fisico, ".") = 0 And IsNumeric(Chr(KeyAscii)) Then
        KeyAscii = 0
    End If
 Else
     KeyAscii = 0
End If
If (KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete) And Len(Trim(ctrl_fisico.Text)) = 1 Then
    ctrl_fisico.Text = "0"
End If
End Sub
Private Sub ctrl_fisico_LostFocus()
ctrl_fisico.BackColor = vbWhite
End Sub

Private Sub ctrl_fisico_Validate(Cancel As Boolean)
If ctrl_fisico.Text = "" Or Len(ctrl_fisico.Text) = 0 Then
    ctrl_fisico.Text = "0"
End If
End Sub

Private Sub txt_idprod_Change()
PropertyChanged "idprod"
End Sub
Private Sub txt_ncat_change()
PropertyChanged "ncat"
End Sub
Private Sub txt_nscat_change()
PropertyChanged "nscat"
End Sub
Private Sub txt_descr_change()
PropertyChanged "descr"
End Sub
Private Sub ctrl_fisico_change()
If Len(ctrl_fisico) = 0 Then
'    ctrl_fisico.Text = "0"
End If
PropertyChanged "fisico"
End Sub


Private Sub UserControl_Initialize()

End Sub


