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

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Grid salvando no banco com checkbox
Alptraum
CURITIBA
PR - BRASIL
ENUNCIADA !
Postada em 01/08/2007 12:12 hs            
Olá pessoal,

Eu tenho uma tela de diagnóstico. Funciona mais ou menos assim:

A primeira coluna no Grid é a pergunta, ex. : "Já fez tratamento estético?"
Na segunda eu preciso de uma checkox, pra ficar sim/não

Eu já descobri como editar o Grid, mais preciso descobrir como colocar a checkbox e salvar tudo isso em banco.

Alguem me da uma luz

Obrigado
   
Alptraum
CURITIBA
PR - BRASIL
ENUNCIADA !
Postada em 02/08/2007 11:46 hs            
ninguem tem ideia de como fazer isso?

se alguem souber colocar o checkbox já ajuda mto
   
ghost_jlp
Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 02/08/2007 13:54 hs            
Qual grid vc usa?
   
Alptraum
CURITIBA
PR - BRASIL
Postada em 02/08/2007 13:55 hs            
MSflexgrid

banco access com dao
     
ghost_jlp
Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 03/08/2007 14:22 hs            
Bom, o MSFlexgrid não tem a checkbox. Só alguns ActiveX de terceiros e o ListView. Se vc quiser pode colocar a letra "X" como se fosse um Check.
 
O ListView só coloca o checkbox no primeiro campo.
 
Posso ver  um jeito de "disfarçar" um checkbox no flexgrid mas eu preciso fazer uns testes.
 
Conseguindo ou não ou até achando uma outra solução que não seja as que eu passei eu posto.
 
falows!
   
ghost_jlp
Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843
SÃO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 03/08/2007 20:06 hs            
Achei um exemplo!!!!
Realmente muito simples e prático, parabéns ao autor!!
***************************************************
Para rodar o exemplo abaixo crie um projeto, coloque um flexgrid e cole o código abaixo:
Const strChecked = "þ"
Const strUnChecked = "q"
Private Sub Form_Load()
        With MSFlexGrid1
            .Rows = 10
            .Cols = 3
           
            .AllowUserResizing = flexResizeBoth
                       
            'name the cols
            For i = 1 To .Cols - 1
                .Row = 0
                .Col = i
                .Text = "Column " & i
            Next i
           
            'name the rows
            For i = 1 To .Rows - 1
                .Col = 0
                .Row = i
                .Text = "Row " & i
            Next i
                       
            'define fields as checkbox
            For y = 1 To .Rows - 1
                For x = 1 To .Cols - 1
                    .Row = y
                    .Col = x
                    .CellFontName = "Wingdings"
                    .CellFontSize = 14
                    .CellAlignment = flexAlignCenterCenter
                    .Text = strUnChecked
                Next x
            Next y
        End With
   
End Sub
Private Sub Form_Resize()
    MSFlexGrid1.Width = Me.ScaleWidth
    MSFlexGrid1.Height = Me.ScaleHeight
End Sub
Private Sub TriggerCheckbox(iRow As Integer, iCol As Integer)
        With MSFlexGrid1
            If .TextMatrix(iRow, iCol) = strUnChecked Then
                .TextMatrix(iRow, iCol) = strChecked
            Else
                .TextMatrix(iRow, iCol) = strUnChecked
            End If
        End With
End Sub
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Or KeyAscii = 32 Then 'Enter/Space
        With MSFlexGrid1
            Call TriggerCheckbox(.Row, .Col)
        End With
    End If
End Sub
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = 1 Then
        With MSFlexGrid1
            If .MouseRow <> 0 And .MouseCol <> 0 Then
                Call TriggerCheckbox(.MouseRow, .MouseCol)
            End If
        End With
    End If
End Sub
'********************************************************
autor: Chris Pietschmann
site: http://PietschSoft.itgo.com
fonte (com o exemplo): http://www.planet-source-code.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!43129/lngWid!1/anyname.htm
 
 
falows!!
   
Página(s): 1/2      PRÓXIMA »


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

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

HTML DESLIGADO

     
 VOLTAR

  



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