Retroceder   Foros del Web > Temas generales de computación > Programación > Visual Basic

Respuesta
 
Herramientas Desplegado
Antiguo 30-ago-2006, 06:13   #1 (permalink)
Jennifer_munn ha deshabilitado el karma
 
Fecha de Ingreso: marzo-2005
Mensajes: 259
Pregunta Msflexgrid

Bueno, allá voy con el más dificil todavia...
Alguien sabe cómo puedo seleccionar texto dentro de una celda de un MSFlexgrid??? y situar el cursor al principio, al final o entre las letras ya escritas???
ahí queda eso...
Jennifer_munn está desconectado   Responder Citando
Antiguo 30-ago-2006, 08:04   #2 (permalink)
tazzito ha deshabilitado el karma
 
Avatar de tazzito
 
Fecha de Ingreso: agosto-2006
Mensajes: 363
queeee tal señorita vamos por parte un msflexgrid no tiene la posibilidad de edicion, para esto se trabaja con otras grillas o en su defecto con un textbox que hace las veces de celda activa, esto no es totalmente dificil, solo debes manejarte bien con el posisionamiento, deberias probar con algo asi
DpiRow=200
textedicion.top = (grilla.rows * DpiRow ) grilla1.top
textedicion.width = grilla.colwith(grilla.col)
txtedicion.text = grilla.text
txtedicion.visible=true
txtedicion.selstart =0
txtedicion.selenght = len(txtedicion.text)

cozas asi jugar con el valor del dpi etc
tazzito está desconectado   Responder Citando
Antiguo 04-sep-2006, 22:53   #3 (permalink)
Neverhood está en el buen camino
 
Avatar de Neverhood
 
Fecha de Ingreso: noviembre-2002
Ubicación: Uruapan, Michoacán.
Mensajes: 99
Enviar un mensaje por ICQ a Neverhood Enviar un mensaje por MSN a Neverhood
No es algo sencillo, pero aquí lo tienes:

El código del FLEX:
Código:
Private Sub Flex1_KeyPress(KeyAscii As Integer)
    Dim LeftCel As Long, LeftFlx As Long
    Dim TopCel As Long, TopFlx As Long
    Dim WidthCel As Long, HeightCel As Long
    Dim Contenido As String
    Dim Fila As Long, Columna As Long

    If KeyAscii = vbKeyReturn Then
        Fila = Flex1.Row: Columna = Flex1.Col
        Contenido = Flex1.Text
        ContenidoAnterior = Flex1.Text
        If Fila > 0 And Columna = 1 Then 'solo si quieres limitar cual columna es editable, si no, elimina esta linea
            With Flex1
                LeftCel = .CellLeft
                TopCel = .CellTop
                WidthCel = .CellWidth
                HeightCel = .CellHeight
                LeftFlx = .Left
                TopFlx = .Top
                Contenido = .Text
                .Enabled = False
            End With

            With TxtDecim
                .Height = HeightCel
                .Width = WidthCel
                .Left = LeftCel + LeftFlx
                .Top = TopCel + TopFlx
                .Text = Contenido
                .Visible = True
                .SetFocus
            End With
        End If

        KeyAscii = 0
    End If
End Sub
Ahora el código del TEXT:
Código:
Private Sub TxtDecim_KeyPress(KeyAscii As Integer)
    Dim ContenidoText As String
    
    If KeyAscii = vbKeyReturn Then
        With TxtDecim
            ContenidoText = .Text
            .Visible = False
        End With
        With Flex1
            .Text = ContenidoText
            .Enabled = True
            .SetFocus
        End With
    End If
End Sub
Espero te sirva!!! Y cualquier duda, estoy a tus órdenes
__________________
Un saludo desde Uruapan, Michoacán (México)

L.I. Enrique Campos Gómez
Gerente General
MULTISISTEMAS DE URUAPAN
Neverhood está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 05:22.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93