Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/03/2010, 07:37
kail521
(Desactivado)
 
Fecha de Ingreso: julio-2009
Mensajes: 33
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Saber dias de el mes restantes

encontre la respuesta:

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim dia As Integer = Today.Day
Dim dias_mes As Integer = DateTime.DaysInMonth(Now.Year, Now.Month)
Dim semana As Integer = getNumeroSemana(Date.Today)
Dim restan As Integer = (dias_mes - dia)
Dim n As Integer
For i As Integer = 1 To restan
If Weekday(New DateTime(Date.Today.Year, Date.Today.Month, i), FirstDayOfWeek.System) = FirstDayOfWeek.Saturday Then
n += 1
End If
Next
MessageBox.Show(n, "", MessageBoxButtons.OK)
End Sub
Function getNumeroSemana(ByVal fecha As Date) As Integer
Dim sFecha As String
sFecha = "01/" & Month(fecha) & "/" & Year(fecha)
getNumeroSemana = DatePart("ww", fecha) - DatePart("ww", DateValue(sFecha)) + 1
End Function