Click here to Skip to main content
15,904,416 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGraphical fonts vb.net Pin
anthony Glover5-Feb-07 12:36
anthony Glover5-Feb-07 12:36 
AnswerRe: Graphical fonts vb.net Pin
Christian Graus5-Feb-07 13:05
protectorChristian Graus5-Feb-07 13:05 
Questionsimple webbrowser interface - a problem Pin
noki15-Feb-07 12:15
noki15-Feb-07 12:15 
QuestionQuestion regarding update on a event Pin
godspeed1235-Feb-07 11:47
godspeed1235-Feb-07 11:47 
AnswerRe: Question regarding update on a event Pin
Christian Graus5-Feb-07 12:13
protectorChristian Graus5-Feb-07 12:13 
QuestionMAX value property problem for Datetime Picker Pin
parmi4u5-Feb-07 8:17
parmi4u5-Feb-07 8:17 
AnswerRe: MAX value property problem for Datetime Picker Pin
TwoFaced5-Feb-07 10:02
TwoFaced5-Feb-07 10:02 
GeneralRe: MAX value property problem for Datetime Picker Pin
TwoFaced5-Feb-07 10:55
TwoFaced5-Feb-07 10:55 
I made a quick change to how I think you should validate the date selected. This will allow you to easily handle multiple datetimepickers (of which you said you had) without really changing the code.
Public Class Form1
    Dim LastDate As Date

    Private Sub DateTimePicker_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePicker1.GotFocus, DateTimePicker2.GotFocus
        LastDate = CType(sender, DateTimePicker).Value
    End Sub

    Private Sub DateTimePicker_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged, DateTimePicker2.ValueChanged
        Dim dtp As DateTimePicker = DirectCast(sender, DateTimePicker)

        If Date.Compare(dtp.Value, Now) > 0 Then
            dtp.Value = LastDate
        End If
    End Sub
End Class
Notice that after 'Handles' in each delaration I have added the appropriate events for Two DateTimePickers. You can add more in the same manner which is all you need to do to validate them all.
QuestionHandle Keyword? Pin
Rahithi5-Feb-07 7:40
Rahithi5-Feb-07 7:40 
AnswerRe: Handle Keyword? Pin
TwoFaced5-Feb-07 8:26
TwoFaced5-Feb-07 8:26 
GeneralRe: Handle Keyword? Pin
Rahithi5-Feb-07 11:34
Rahithi5-Feb-07 11:34 
GeneralRe: Handle Keyword? Pin
TwoFaced5-Feb-07 12:13
TwoFaced5-Feb-07 12:13 
QuestionProblem with Readline - I broke it ! Pin
rfrank53565-Feb-07 7:36
rfrank53565-Feb-07 7:36 
AnswerRe: Problem with Readline - I broke it ! Pin
Lucan075-Feb-07 13:04
Lucan075-Feb-07 13:04 
GeneralRe: Problem with Readline - I broke it ! Pin
rfrank53566-Feb-07 5:06
rfrank53566-Feb-07 5:06 
QuestionWindows Vista Purchase Pin
sidkraft5-Feb-07 7:25
sidkraft5-Feb-07 7:25 
AnswerRe: Windows Vista Purchase Pin
Christian Graus5-Feb-07 10:39
protectorChristian Graus5-Feb-07 10:39 
GeneralRe: Windows Vista Purchase Pin
Lucan075-Feb-07 11:58
Lucan075-Feb-07 11:58 
GeneralRe: Windows Vista Purchase Pin
sidkraft5-Feb-07 12:42
sidkraft5-Feb-07 12:42 
GeneralRe: Windows Vista Purchase Pin
Christian Graus5-Feb-07 13:41
protectorChristian Graus5-Feb-07 13:41 
GeneralRe: Windows Vista Purchase Pin
sidkraft5-Feb-07 14:58
sidkraft5-Feb-07 14:58 
QuestionByte data type in sql server Pin
manisghouri5-Feb-07 6:32
manisghouri5-Feb-07 6:32 
AnswerRe: Byte data type in sql server Pin
Colin Angus Mackay5-Feb-07 13:36
Colin Angus Mackay5-Feb-07 13:36 
GeneralRe: Byte data type in sql server Pin
manisghouri6-Feb-07 0:09
manisghouri6-Feb-07 0:09 
QuestionFill color on data report Pin
Acer36205-Feb-07 6:03
Acer36205-Feb-07 6:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.