RicardoBastos Posted June 17, 2009 at 03:29 PM Report Share #273106 Posted June 17, 2009 at 03:29 PM Boas tardes P@P eu tenho uma duvida sobre os eventos no vb podemos chamar algum evento dentro de outro?? :nono1: por exemplo dentro te de um evento que verifica se o utilizador clica na tecla enter do teclado chamar um evento de um botão que adiciona algo numa datagrid por exemplo. isto é possível? Abraços CUMPS Link to comment Share on other sites More sharing options...
bioshock Posted June 17, 2009 at 03:31 PM Report Share #273107 Posted June 17, 2009 at 03:31 PM Sim, claro que podes. Link to comment Share on other sites More sharing options...
RicardoBastos Posted June 17, 2009 at 03:33 PM Author Report Share #273108 Posted June 17, 2009 at 03:33 PM podes dizer me como faço? é que estou a dar em maluco já tentei varias coisas e nada Link to comment Share on other sites More sharing options...
bioshock Posted June 17, 2009 at 04:27 PM Report Share #273135 Posted June 17, 2009 at 04:27 PM Será isto: http://www.portugal-a-programar.pt/index.php?showtopic=28434 Link to comment Share on other sites More sharing options...
ribeiro55 Posted June 17, 2009 at 06:30 PM Report Share #273155 Posted June 17, 2009 at 06:30 PM RaiseEvent Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
RicardoBastos Posted June 18, 2009 at 08:38 AM Author Report Share #273260 Posted June 18, 2009 at 08:38 AM Será isto: http://www.portugal-a-programar.pt/index.php?showtopic=28434 não, não é isso que eu quero RaiseEvent mas o raiseevent não é só para funções declaradas em classes ou modulos? Link to comment Share on other sites More sharing options...
Weasel Posted June 18, 2009 at 09:12 AM Report Share #273268 Posted June 18, 2009 at 09:12 AM Isso é o mais simples que pode haver, se percebi bem a tua questão, dentro do evento que apanha o pressionar da tecla entrer fazes Button1.PerformClick() Trocas apenas o Button1 para o nome do teu botão. Knowledge to the masses Link to comment Share on other sites More sharing options...
ribeiro55 Posted June 18, 2009 at 09:42 AM Report Share #273274 Posted June 18, 2009 at 09:42 AM Se não é o RaiseEvent que procuras, então podes chamar directamente os subs dos eventos. Por exemplo, se tiveres um Click de um botão, chamas o sub que lida com o evento. Button1_Click(Nothing,Nothing) Quem diz o botão, diz qualquer sub: Form1_Load(Nothing,Nothing) Isto apenas para correr o sub. Repara que os argumentos vão Nothing. Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
RicardoBastos Posted June 18, 2009 at 12:39 PM Author Report Share #273331 Posted June 18, 2009 at 12:39 PM sim era mesmo isso Waesel e ribeiro55 a do Waesel desconhecia mas o do ribeiro ja tinha tentado não sabia era o que havia de meter nos parametros Obrigadão 😛 Cumps Link to comment Share on other sites More sharing options...
ribeiro55 Posted June 18, 2009 at 12:43 PM Report Share #273334 Posted June 18, 2009 at 12:43 PM Marca como resolvido. Não precisas de meter um tag "RESOLVIDO". Nunca criei nenhum tópico aqui, por isso não te posso ser específico, mas parece que existe algures um button ou algo do género com "Topic Solved", que vai meter a imagem do tópico com um visto verde. É no "Topic Solved" que deves carregar quando resolves o problema. Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
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