joninho Posted March 1, 2006 at 02:27 PM Report Share #16140 Posted March 1, 2006 at 02:27 PM Botões do MSGBOX do Visual Basic 6 Para quem não sabe a sintaxe básica do msgbox eh: Msgbox “Bem vindo ao nosso programa de gestão”,3,”Boas-vindas” “Bem-vindo ao nosso programa de gestão” é o texto k aparece na Box. 3 é o número do conjunto de botões. “Boas Vindas” é o título da box. Podes alterar os botões da box, mudando o número em vex d 3, podes por outro consoante os seguintes Botões 1: http://img500.imageshack.us/img500/930/botes11qe.jpg Botões 2: http://img500.imageshack.us/img500/8329/botes29cb.jpg Botões 3: http://img297.imageshack.us/img297/7695/botes31xh.jpg Botões 4: http://img297.imageshack.us/img297/8566/botes41xv.jpg Botões 5: http://img297.imageshack.us/img297/8928/botes52qk.jpg Botões 6: http://img500.imageshack.us/img500/5508/botes65bs.jpg Cumps... lol klkr dia meto os numeros dos tipos d boxs, d aviso pergunta etc.. Link to comment Share on other sites More sharing options...
vbmaster Posted March 1, 2006 at 02:52 PM Report Share #16150 Posted March 1, 2006 at 02:52 PM Nice para os iniciantes... Normalmente agora já não se usa os numeros, faz-se cenas tipo vbOKOnly+vbCritical que junta uma msgbox com só um OK e com um símbolo de informação crítica. Ops, mas isto já é em vb.net.... 😄 Link to comment Share on other sites More sharing options...
Tiago Salgado Posted March 1, 2006 at 04:09 PM Report Share #16167 Posted March 1, 2006 at 04:09 PM Nice para os iniciantes... Normalmente agora já não se usa os numeros, faz-se cenas tipo vbOKOnly+vbCritical que junta uma msgbox com só um OK e com um símbolo de informação crítica. Ops, mas isto já é em vb.net.... 😄 Não é apenas em VB.NET ...em VB6 tambem podes usar essa junção. Exemplo: MsgBox "Deseja Sair?",vbYesNo+vbQuestion,"titulo" Cumps Link to comment Share on other sites More sharing options...
vbmaster Posted March 1, 2006 at 04:42 PM Report Share #16169 Posted March 1, 2006 at 04:42 PM Pois, sendo assim é sempre melhor usares esses termos que os numeros Joninho.... 😄 Link to comment Share on other sites More sharing options...
joninho Posted March 1, 2006 at 07:21 PM Author Report Share #16240 Posted March 1, 2006 at 07:21 PM lol, ok entao eu depois modifico o topico... 👍 lol Link to comment Share on other sites More sharing options...
Tiago_22 Posted May 4, 2006 at 08:14 PM Report Share #25683 Posted May 4, 2006 at 08:14 PM Boas! Exemplo: MsgBox "Deseja Sair?",vbYesNo+vbQuestion,"titulo" da para interagir com estes botoes? por exemplo usar depois um If a dizer se o ultilizador responder yes entao ele faz isto senao faz akilo... ou para ixo tenhu k fazer como o joninho... cumps 😄 Link to comment Share on other sites More sharing options...
joninho Posted May 4, 2006 at 08:40 PM Author Report Share #25689 Posted May 4, 2006 at 08:40 PM usar MsgBox "Deseja Sair?",vbYesNo+vbQuestion,"titulo" ou os numeros é igual, e com os ifs podes fazer o msgbox tb retorna valores se fixeres a = MsgBox "Deseja Sair?",vbYesNo+vbQuestion,"titulo" depois podes meter um if ou entao if MsgBox "Deseja Sair?",vbYesNo+vbQuestion,"titulo" = vbYesNo then etc... 😄 lol precebes? Link to comment Share on other sites More sharing options...
Tiago_22 Posted May 5, 2006 at 10:00 AM Report Share #25740 Posted May 5, 2006 at 10:00 AM o codigo seguinte e para um botao que tem o objectivo de limpar o texto escrito... mas para ser mais completo 😁 pergunta se n pretende guardar o texto actual... Private Sub mnunew_Click(Index As Integer) Dim numficheiro MsgBox "Deseja guardar as alterações feitas no documento actual?", vbYesNo + vbQuestion, "Guardar" If vbYes Then CommonDialog1.ShowSave numficheiro = FreeFile If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName & ".txt" For Output As numficheiro Print #numficheiro, Text1.Text Close #numficheiro End If Else Text1.Text = "" End If End Sub mas axi n funciona... porque quer diga sim quer diga não ele pede para gravar... axi como o joninho disse ou pelo menos como eu entrepertei (o codigo que vou por abaixo) tambem não dá... Private Sub mnunew_Click(Index As Integer) Dim numficheiro MsgBox "Deseja guardar as alterações feitas no documento actual?", vbYesNo + vbQuestion, "Guardar" If MsgBox "Deseja guardar as alterações feitas no documento actual?", vbYesNo + vbQuestion, "Guardar"=vbYes Then CommonDialog1.ShowSave numficheiro = FreeFile If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName & ".txt" For Output As numficheiro Print #numficheiro, Text1.Text Close #numficheiro End If Else Text1.Text = "" End If End Sub alguem me pode ajudar e explicar como ixto funciona? cumps a tds 👍 Link to comment Share on other sites More sharing options...
UnKnowN Posted May 5, 2006 at 11:33 AM Report Share #25745 Posted May 5, 2006 at 11:33 AM O Código correcto é : Private Sub Command1_Click() If MsgBox("Sair?", vbYesNo + vbQuestion, "Sair") = vbYes Then End End If End Sub Agr tu perguntas: Ah e Tal, Onde é que está a MsgBox ... dizes If a MsgBox tal e tal ... ? E Eu respondo, só se poe 1 vez a MsgBox pk se puseres duas ele pergunta-te 2 vezes 🙂 Code Fornecido por Psiico 😄 Link to comment Share on other sites More sharing options...
Tiago Salgado Posted May 5, 2006 at 11:46 AM Report Share #25748 Posted May 5, 2006 at 11:46 AM Ou entao ainda podes fazer do genero Private Sub mnunew_Click(Index As Integer) Dim numficheiro as Integer Dim resposta as String resposta = MsgBox ("Deseja guardar as alterações feitas no documento actual?", vbYesNo + vbQuestion, "Guardar") If resposta = vbYes Then CommonDialog1.ShowSave numficheiro = FreeFile If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName & ".txt" For Output As numficheiro Print #numficheiro, Text1.Text Close #numficheiro End If Else Text1.Text = "" End If End Sub Link to comment Share on other sites More sharing options...
UnKnowN Posted May 5, 2006 at 12:46 PM Report Share #25764 Posted May 5, 2006 at 12:46 PM Ou entao ainda podes fazer do genero Private Sub mnunew_Click(Index As Integer) Dim numficheiro as Integer Dim resposta as String resposta = MsgBox ("Deseja guardar as alterações feitas no documento actual?", vbYesNo + vbQuestion, "Guardar") If resposta = vbYes Then CommonDialog1.ShowSave numficheiro = FreeFile If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName & ".txt" For Output As numficheiro Print #numficheiro, Text1.Text Close #numficheiro End If Else Text1.Text = "" End If End Sub EhEh também tinha pensado nisso 😄 Link to comment Share on other sites More sharing options...
joninho Posted May 5, 2006 at 04:33 PM Author Report Share #25817 Posted May 5, 2006 at 04:33 PM pronto no fundo é isso tudo que eu tava a tentar diser XD lol como vês é muito simples 😉 Link to comment Share on other sites More sharing options...
Tiago_22 Posted May 5, 2006 at 04:41 PM Report Share #25820 Posted May 5, 2006 at 04:41 PM obrigado a todos 😉 principalmente ao Tiago Salgado. joninho, no fundo, no fundo foi quase isso que eu percebi da tua explicaçao 😉 cumps 😛 Link to comment Share on other sites More sharing options...
joninho Posted May 5, 2006 at 04:53 PM Author Report Share #25825 Posted May 5, 2006 at 04:53 PM lol d nada 😉 tamos aqui para ajudar 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