Jump to content
dipacheco

Botao para ver todas as datas

Recommended Posts

dipacheco

Boas pessoal... tenho um botao no form q abre outro form so com um calendário. O q eu queria era ir à BD ver as datas em q um cliente usou isto no mes corrente e assinalar as datas no calendario. é possivel??

Share this post


Link to post
Share on other sites
dipacheco

fiz isto mas nao está a dar...

Imports System.Data.SqlClient

Public Class Calendar

    Dim connect As SqlConnection
    Dim command As SqlCommand
    Dim reader As SqlDataReader

    Private Sub Calendar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.CenterToScreen()
        connect = New SqlConnection("Data Source=PACHECO-PC\SQLEXPRESS;Initial Catalog=Teste;Integrated Security=True")
        connect.Open()
        command = New SqlCommand("SELECT Dataentradadia,Dataentradames,Dataentradaano FROM Registoentradas WHERE Cliente='" & EntSai.TextBox2.Text & "'", connect)
        reader = command.ExecuteReader
        While reader.Read
            MonthCalendar1.AddBoldedDate(New DateTime(reader(2), reader(1), reader(0)))
        End While
        reader.Close()
        connect.Close()
    End Sub
End Class

Alguma sugestão?

Share this post


Link to post
Share on other sites
Caça

Depois de teres inserido as datas, é necessário actualizar o calendário

MonthCalendar1.UpdateBoldedDates()


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites
dipacheco

porreiro! ;) olha la caça... eu pensei q este "bold" fosse criar algo em torno da data... tipo um marcador, e não por as letras negrito... ha alguma maneira d o fazer sem ser com o bold???

Share this post


Link to post
Share on other sites
dipacheco

pois... eu sei por a marca no dia d hoje pq vi pela net q existe o showtodaycircle mas so existe para o dia de hoje, acho eu! ;) obrigado de qlq forma.

Share this post


Link to post
Share on other sites
bioshock

Até poderias desenhar tu próprio o circulo , mas o MonthCalendar não possui o evento Paint. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.