USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Preciso de ajuda para este codigo
Lima
STUTTGART
DE - ALEMANHA
ENUNCIADA !
Postada em 12/01/2008 20:56 hs         
boas preciso de ajuda para este codigo
eu tenho 2 chekbox e quando insiro este comando só uma posso activar e eu queria activar as 2 será que me podem ajudar?

Private Sub Command1_Click()
Text9.Text = Text1.Text & vbCrLf & vbCrLf & Text2.Text & vbCrLf & Text3.Text & vbCrLf & Text6.Text & vbCrLf & Text7.Text & vbCrLf & Text8.Text
If Check1.Value = 1 Then
Text9.Text = Text1.Text & vbCrLf & vbCrLf & Text2.Text & vbCrLf & vbCrLf & Text3.Text & vbCrLf & "««««««««««««««««««««" & vbCrLf & Text4.Text & vbCrLf & Text6.Text & vbCrLf & Text7.Text & vbCrLf & Text8.Text
Else
Text9.Text = Text1.Text & vbCrLf & vbCrLf & Text2.Text & vbCrLf & Text3.Text & vbCrLf & Text6.Text & vbCrLf & Text7.Text & vbCrLf & Text8.Text
End If
If Check2.Value = 1 Then
Text9.Text = Text1.Text & vbCrLf & vbCrLf & Text2.Text & vbCrLf & vbCrLf & Text3.Text & vbCrLf & "««««««««««««««««««««" & vbCrLf & Text5.Text & vbCrLf & Text6.Text & vbCrLf & Text7.Text & vbCrLf & Text8.Text
Else
Text9.Text = Text1.Text & vbCrLf & vbCrLf & Text2.Text & vbCrLf & Text3.Text & vbCrLf & Text6.Text & vbCrLf & Text7.Text & vbCrLf & Text8.Text
End If
End Sub

Obrigado
TÓPICO EDITADO
 
Tiranossauro
DOIS IRMÃOS
RS - BRASIL
ENUNCIADA !
Postada em 12/01/2008 23:07 hs            
Se vc colocar o resultado de check1 ativado numa variável e do check2 em outra ?
 
Pelo que entendi vc coloca todos os resultados na Text9.text
 
Use a text9 para o check1 e crie uma text99 para o check2.
 
Se não entendi então poste novamente com mais explicações.
 
Abraço
   
Lima
STUTTGART
DE - ALEMANHA
ENUNCIADA !
Postada em 13/01/2008 07:58 hs         
não é bem isso,vou tentar postar isto duma maneira mais simples
tenho text1:text2:text3e Text4
tenho 2 checksbox e tenho uma click box
e eu quero

Text4 = Text1
se clicar numa ckeck o texto seria
Text4 = Text1 & Text2
se clicar a gora na outra o texto seria
Text4 = Texto1 & Texto3
mas se estiverem as 2 activadas o texto seria
Texto4 = texto1 & texto2 & text3
o meu problema é que dentro do click_comand
não consigo colocar os comandos da check

Private Sub Command1_Click()
Text 4.Text = Text1.Text
If Check1.Value = 1 Then
Text4.text = text1.text & text2.text
else
text4.text= text1.text
end if
If Check2.Value = 1 Then
Text4.text = text1.text & text2.text
else
text4.text= text1.text
end if
end sub
espero que agora seja melhor para entender
ou seja quero colocar tudo dentro do comando Private Sub Command1_click()
TÓPICO EDITADO
 
Treze
Pontos: 2843 Pontos: 2843
SÃO VICENTE
SP - BRASIL
Postada em 14/01/2008 09:05 hs            
tente dessa forma
 
If Check1.Value = 1 And Check2.Value = 0 Then
Text4.Text = Text1.Text & Text2.Text
ElseIf Check1.Value = 0 And Check2.Value = 1 Then
Text4.Text = Text2.Text & Text3.Text
ElseIf Check1.Value = 1 And Check2.Value = 1 Then
Text4.Text = Text1.Text & Text2.Text & Text3.Text
End If
acredito que seja isso que você deseja
     
Tiranossauro
DOIS IRMÃOS
RS - BRASIL
ENUNCIADA !
Postada em 14/01/2008 09:14 hs            
acho que o command button não tem função, mas ... não sei
 
Private Sub Check1_Click()
If Check1.Value = 1 and Check2.Value = 0 Then
   Text4.text = text1.text & text2.text
endif
If Check1.Value = 0 and Check2.Value = 1 Then
   Text4.text = text1.text & text3.text
endif
If Check1.Value = 1 and Check2.Value = 1 Then
   Text4.text = text1.text & text2.text &  text3.text
endif
If Check1.Value = 0 and Check2.Value = 0 Then
   " aqui vc coloca o que quer que apareça quando nenhum estiver clicado
endif
End sub
Private Sub Check2_Click()
If Check1.Value = 1 and Check2.Value = 0 Then
   Text4.text = text1.text & text2.text
endif
If Check1.Value = 0 and Check2.Value = 1 Then
   Text4.text = text1.text & text3.text
endif
If Check1.Value = 1 and Check2.Value = 1 Then
   Text4.text = text1.text & text2.text &  text3.text
endif
If Check1.Value = 0 and Check2.Value = 0 Then
   " aqui vc coloca o que quer que apareça quando nenhum estiver clicado
endif
End sub
 
Se vc usar um index no check box pode fazer tudo em uma sub apenas. Fica mais fácil de fazer manutenção.
Abraço
   
Lima
STUTTGART
DE - ALEMANHA
ENUNCIADA !
Postada em 14/01/2008 14:30 hs         
é isto mesmo que procurava :)

Valeu pela ajuda
   
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página