Ridelight Posted April 13, 2006 at 08:15 AM Report #22016 Posted April 13, 2006 at 08:15 AM Boas, ando a iniçiar-me em vb, gostaria de saber como desactivar a tecla Alt para não dar para fazer Alt Tab e a tecla Win ! Da para abrir duas forms dentro de uma tela ? Thanks ! Regras do FÓRUM
UnKnowN Posted April 13, 2006 at 07:43 PM Report #22049 Posted April 13, 2006 at 07:43 PM http://www.gh-gold.co.uk/keycodes.php Info Fornecida por KhAoTiK_TaChYoN 😁 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyTab Then ' Para o Tab, não encontrei para o Alt MsgBox "Não me parece..." End If End Sub E a do Win nao sei também , é uma questão de ires tentand várias que nao conheças à partida 😁
David Pintassilgo Posted April 13, 2006 at 08:39 PM Report #22062 Posted April 13, 2006 at 08:39 PM Boas, ando a iniçiar-me em vb, gostaria de saber como desactivar a tecla Alt para não dar para fazer Alt Tab e a tecla Win ! Da para abrir duas forms dentro de uma tela ? Thanks ! AAAA,...busted!!!! 😁afinal sempre descubri um pequeno bug no teu programa ó k? 😁🙂 :) 🙂 cool stuffs to check. http://blog.zxcoders.com//
UnKnowN Posted April 14, 2006 at 06:29 PM Report #22149 Posted April 14, 2006 at 06:29 PM Gostava de receber FeedBack seja ele positivo ou negativo àcerca da ajuda (ou nao) que prestei 😁
Ridelight Posted April 14, 2006 at 08:06 PM Author Report #22152 Posted April 14, 2006 at 08:06 PM Boas, realmente desactiva a tecla tab, mas so depois de eu clicar na Enter para introduzir a pass, antes funciona. 😁 Regras do FÓRUM
Tiago Salgado Posted April 14, 2006 at 10:34 PM Report #22160 Posted April 14, 2006 at 10:34 PM Porque estas certamente a por o codigo num evento errado...
UnKnowN Posted April 15, 2006 at 10:03 AM Report #22177 Posted April 15, 2006 at 10:03 AM 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 😁
Ridelight Posted April 15, 2006 at 11:58 AM Author Report #22186 Posted April 15, 2006 at 11:58 AM 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 Regras do FÓRUM
Ridelight Posted April 15, 2006 at 12:02 PM Author Report #22187 Posted April 15, 2006 at 12:02 PM E ja agora alguem me pode dizer como criar um splash screen e um menu com duas opções em que na 1 abra a form1 e na 2 abra a form 2! Regras do FÓRUM
vbmaster Posted April 15, 2006 at 12:17 PM Report #22189 Posted April 15, 2006 at 12:17 PM 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....
UnKnowN Posted April 15, 2006 at 01:20 PM Report #22196 Posted April 15, 2006 at 01:20 PM 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
Tiago Salgado Posted April 15, 2006 at 01:24 PM Report #22198 Posted April 15, 2006 at 01:24 PM Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyTab ThenMsgBox "Não me parece..." End IfEnd Sub Mete este codigo no evento KeyDown do Form
UnKnowN Posted April 15, 2006 at 01:25 PM Report #22199 Posted April 15, 2006 at 01:25 PM pk do Form ? 😁
Ridelight Posted April 15, 2006 at 03:14 PM Author Report #22221 Posted April 15, 2006 at 03:14 PM 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 ! 🙂 Regras do FÓRUM
UnKnowN Posted April 15, 2006 at 04:11 PM Report #22227 Posted April 15, 2006 at 04:11 PM Ya era assim Ridelight, apesar de nao ter percebido o porquê da maneira do Tiago Salgado tenta a maneira dele 🙂
Tiago Salgado Posted April 15, 2006 at 05:46 PM Report #22238 Posted April 15, 2006 at 05:46 PM Posso estar a entender mal o que pretendes...tu queres q o utilizador não consiga carregar na tecla TAB apenas qd está com o cursor na textbox ou em todo o Form ?
Ridelight Posted April 15, 2006 at 06:20 PM Author Report #22248 Posted April 15, 2006 at 06:20 PM Eu kero k nunca possa clicar na tecla TAB nem na tecla WINDOWS Regras do FÓRUM
Tiago Salgado Posted April 15, 2006 at 07:31 PM Report #22256 Posted April 15, 2006 at 07:31 PM Entao tens q por isso no evento KeyDown da textbox e do Form ...pq s apenas puseres na textbox caso n possua a focus, e seja o Form o proprietario do Focus, irá permitir o uso da tecla TAB ...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now