SoloCodigo
Programación General => Visual Basic 6.0 e inferiores => Mensaje iniciado por: rechy en Lunes 2 de Febrero de 2004, 17:13
-
Hola amigos, tengo el siguiente codigo el cual me incrementa las columnas del Msflexgrid en .5 pero quiero que me las incremente en 0.0020 No he podido lograrlo espero y alguien pueda darme un tip.
Codigo:
Private Sub Command3_Click(Index As Integer)
tabla.Clear
Command2.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Label7.Visible = True
Label8.Visible = True
Label3.Visible = True
Label4.Visible = True
tabla.Visible = True
Dim SG2, SG602 As Single
Dim T As Single
Dim C, R As Integer
Dim BT As Integer
BT = 60
If ((a1.text <> "") And (a2.text <> "") And (t1.text <> "") And (t2.text <> "")) Then
tabla.Cols = (a2 - a1) * 2 + 2
tabla.Rows = (t2 - t1) * 2 + 2
T = t1
R = 0
While (T <= t2)
SG2 = a1
C = 0
While (SG2 <= a2)
If (C = 0) Then
tabla.Col = C
tabla.Row = R + 1
tabla.text = T
End If
If (R = 0) Then
tabla.Col = C + 1
tabla.Row = R
tabla.text = SG2
End If
SG602 = calcular_SG2(SG2, T)
tabla.Col = C + 1
tabla.Row = R + 1
tabla.text = SG602
tabla.text = Format(tabla.text, "#,##0.0000")
If ((SG2 >= 0.6535) And (SG2 <= 0.7795) And (T >= 150) And (T <= 200)) Then
SG602 = SG602
tabla.CellForeColor = &HFF0000
End If
If ((SG2 >= 0.7795) And (SG2 <= 0.825) And (T >= 200) And (T <= 250)) Then
SG602 = SG602
tabla.CellForeColor = &HFF0000
End If
If ((SG2 >= 0.825) And (SG2 <= 1.076) And (T >= 250) And (T <= 300)) Then
SG602 = SG602
tabla.CellForeColor = &HFF0000
End If
SG2 = SG2 + 0.5
C = C + 1
Wend
T = T + 0.5
R = R + 1
Wend
Else
MsgBox ("Faltan datos por capturar")
End If
End Sub
-
Hola rechy.
No me parado a examinar el código que mandas porque me parece un coñazo...
pero te cuento lo siguiente:
Si cuando dices que quieres aumentar las columnas te refieres a que quieres aumentar el número de columnas, asigna a la propiedad Cols el número de columnas que quieres que tenga el control.
Como dices que quieres 'incrementar en 0.0020' supongo que te estás refiriendo al ancho de la columna... pues bien, el valor para la propiedad ColWidth está expresado en twips (1 pulgada = 1440 twips) por lo que 0.0020 es una cojonésima de pulgada, por lo que algo así
MsFlexGrid1.ColWidth(1) = 0.0020
vendría a ser lo mismo que decir que el ancho de la columna 1 es 0 , por lo que la columna no se verá...
No sé si me he explicado muy bien, pero eso.
Abur.
-
Hola Brroz, no me explique bien al parecer, pero no hay cuidado. Ya lo resolvere. Gracias por contestar a todas nuestras dudas y preguntas.
Saludos