ferreira12 Posted October 9, 2013 at 04:27 PM Report #528211 Posted October 9, 2013 at 04:27 PM ola, queria que que a txt2 só ficasse visivel quando eu escrevesse na txt1 'site' ou 'loja', caso contrario devolve uma msgbox. estou a utilizar o codigo abaixo mas nao estou a conseguir colocar da maneira que pertendo. Private Sub txt1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txt1.KeyPress txt2.Visible = False If e.KeyChar = vbCr Then ' If txt2.Visible = True Then txt1.Text = "site" 'End If End If End Sub
nelsonr Posted October 9, 2013 at 04:45 PM Report #528216 Posted October 9, 2013 at 04:45 PM (edited) Algo assim? Private Sub txt1_KeyUp(sender As Object, e As KeyEventArgs) Handles txt1.KeyUp If e.KeyCode = Keys.Enter Then If txt1.Text.ToLower() = "site" Or txt1.Text.ToLower() = "loja" Then txt2.Visible = True Else MessageBox.Show("errado") End If End If End Sub (coloca de inicio a txt2 com o visible=false) Fiz o exemplo no keyup, mas podes seguir a mesma estrutura no keypress Edited October 9, 2013 at 04:43 PM by nelsonr
ferreira12 Posted October 10, 2013 at 08:29 AM Author Report #528308 Posted October 10, 2013 at 08:29 AM Obrigado. problema resolvido....
bids Posted March 24, 2014 at 09:55 PM Report #549864 Posted March 24, 2014 at 09:55 PM tao facil lol Ajude-me?
nelsonr Posted March 24, 2014 at 11:14 PM Report #549890 Posted March 24, 2014 at 11:14 PM tao facil lol E qual o objectivo deste post?
bids Posted March 24, 2014 at 11:25 PM Report #549894 Posted March 24, 2014 at 11:25 PM significa que era muito facil e eu nao sabia 🙂 Ajude-me?
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