Visual Basic - URGENTE porfa

Life is soft - evento anual de software empresarial
 
Vista:

URGENTE porfa

Publicado por Santiago (30 intervenciones) el 01/08/2004 18:23:45
Hola, necesito que un datagrid me ponga un ancho determinado para una de las columnas, para otra otro ancho. QTambién que me ponga un color determinado a la fila en la que estoy seleccionado.

GRACIAS

SANTIAGO :-)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Códigos de EDUARDO ROA

Publicado por tecniCam (186 intervenciones) el 01/08/2004 21:35:14
msh es un Grid y pone tamaño a las diversas columnas según interese.
If talCosa Then
msh.Visible = False
.ColWidth(0) = 1400
.ColWidth(1) = 1850
.ColWidth(2) = 1850
.ColWidth(3) = 1850
.Width = 1400 + (1850 * 3) + 15
.Height = 3480 - 200
.Left = (Me.Width \ 2) - (.Width \ 2)
Else
msh.Visible = False
.ColWidth(0) = 1400
.ColWidth(1) = 1600
.ColWidth(2) = 1500
.ColWidth(3) = 1500
.Width = 1500 * 4 + 15
.Height = 3480 - 200
.Left = (Me.Width \ 2) - (.Width \ 2)
End If
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

PINTAR FILAS

Publicado por tecniCam (186 intervenciones) el 01/08/2004 21:36:43
//Los códigos siguientes son de EDUARDO ROA//

Para pintar filas:

Sub PintarFila(fila As Integer)

Dim i As Integer


For i = 0 To msh.Cols - 1
With msh
If msh.Tag <> -1 Then
.col = i
.Row = msh.Tag
.CellBackColor = &HC0FFFF 'RGB(249, 250, 222)
.CellForeColor = RGB(205, 89, 20)
End If

If fila <> -1 Then
.col = i
.Row = fila
.CellBackColor = &HFFFFFF
.CellForeColor = RGB(1, 1, 1)
End If
End With
Next

msh.Tag = fila
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

PINTAR COLUMNAS

Publicado por tecniCam (186 intervenciones) el 01/08/2004 21:37:52
//Los códigos siguientes son de EDUARDO ROA//

Para pintar columnas:

Sub PintarColumna(col As Integer)

Dim i As Integer


For i = 1 To msh.Rows - 1
With msh

If IsNumeric(msh.TextMatrix(i, col)) Or msh.TextMatrix(i, col) = vbNullString Then

If msh.Tag <> -1 Then
.col = msh.Tag
.Row = i
.CellBackColor = &HC0FFFF 'RGB(249, 250, 222)
.CellForeColor = RGB(205, 89, 20)
End If


.col = col
.Row = i
.CellBackColor = &HFFFFFF
.CellForeColor = RGB(1, 1, 1)

Else
Exit Sub
End If
End With
Next

msh.Tag = col
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar