Jump to content

Recommended Posts

Posted

Boas, realmente desactiva a tecla tab, mas so depois de eu clicar na Enter para introduzir a pass, antes funciona. 😁

Expõe aki o código que utilizaste pode ser que te possamos ajudar 😁

Posted

Aki fica ele .

Option Explicit
    Dim ter As Boolean
Private Sub Command1_Click()
    ter = False
    DisableCtrlAltDelete (False)
    Unload Form1
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Timer1.Enabled = False
        Timer2.Enabled = True
        Text1.Enabled = True
    End If
    End Sub
    
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyTab Then
MsgBox "Não me parece..."
End If
End Sub



Private Sub Form_Load()
    DisableCtrlAltDelete (True)
    ter = True
End Sub


Private Sub Form_LostFocus()
    Form1.SetFocus
End Sub


Private Sub Form_Unload(Cancel As Integer)
    If ter = True Then
        Cancel = 5
    Else
    End If
End Sub


Private Sub Timer1_Timer()
    Form1.SetFocus
    Label2.Caption = 5
End Sub

Private Sub Timer2_Timer()
    Label2.Caption = Val(Label2.Caption) - 1 & "  Segundos para introduzir a password."
    Text1.SetFocus
    If Text1.Text = "pap" Then
        ter = False
        Timer2.Enabled = False
        Timer1.Enabled = False
        Label2.Caption = "5"
        MsgBox "Password aceite, já podes desbloquear o computador."
        Text1.Enabled = False
        Command1.Enabled = True
    End If
    If Val(Label2.Caption) = 0 Then
        Timer1.Enabled = True
        Timer2.Enabled = False
        MsgBox "Excedes-te o tempo disponivel para esta operação."
        Text1.Text = ""
        Text1.Enabled = False
        Command1.Enabled = False
    End If
End Sub


Posted

Isso é easy... tens já forms pré-definidas splash screen, mas o melhor é fazeres a tua própria

Fazes new form, para adicionares menus tens de ir ao Menu Editor, um icon preto e branco pouco depois do abrir, guardar, etc...

aí metes em caption o que quiseres (ex: &Ficheiro - o & é para tornar sublinhado a letra 'F')) e em Name algo como mnuFicheiro;

Depois carregas em insert, e na seta para a direita, de maneira a este novo menu ser inserido no menu principal Ficheiro, e fazes a mesma coisa.

Mostrar forms, penso que sabes....

Posted

Experimenta trocar para baixo a parte do Enter (If KeyAscii = 13) e põe em cima o If KeyCode = vbKeyTab, logo esta parte fika :

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)    
If KeyCode = vbKeyTab Then
MsgBox "Não me parece..." End If
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)    
If KeyAscii = 13 Then        
        Timer1.Enabled = False
        Timer2.Enabled = True        
        Text1.Enabled = True    
End If    
End Sub
Posted

Como assim ?

Option Explicit
    Dim ter As Boolean
Private Sub Command1_Click()
    ter = False
    DisableCtrlAltDelete (False)
    Unload Form1
End Sub


    
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyTab Then
MsgBox "Não me parece..."
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Timer1.Enabled = False
        Timer2.Enabled = True
        Text1.Enabled = True
    End If
    End Sub


Private Sub Form_Load()
    DisableCtrlAltDelete (True)
    ter = True
End Sub


Private Sub Form_LostFocus()
    Form1.SetFocus
End Sub


Private Sub Form_Unload(Cancel As Integer)
    If ter = True Then
        Cancel = 5
    Else
    End If
End Sub


Private Sub Timer1_Timer()
    Form1.SetFocus
    Label2.Caption = 5
End Sub

Private Sub Timer2_Timer()
    Label2.Caption = Val(Label2.Caption) - 1 & "  Segundos para introduzir a password."
    Text1.SetFocus
    If Text1.Text = "pap" Then
        ter = False
        Timer2.Enabled = False
        Timer1.Enabled = False
        Label2.Caption = "5"
        MsgBox "Password aceite, já podes desbloquear o computador."
        Text1.Enabled = False
        Command1.Enabled = True
    End If
    If Val(Label2.Caption) = 0 Then
        Timer1.Enabled = True
        Timer2.Enabled = False
        MsgBox "Excedes-te o tempo disponivel para esta operação."
        Text1.Text = ""
        Text1.Enabled = False
        Command1.Enabled = False
    End If
End Sub


Se for assim nem funciona antes de clicar ENTER nem depois !  🙂

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.