开发者

want if dates selected are in between textbox2 dates and textbox3 dates then textbox1.text="sumit" else textbox1.text="No dates"

开发者 https://www.devze.com 2023-01-28 03:29 出处:网络
If i have three textboxes in my vb.net webform .. Textbox1.text=\"Sumit\" Textbox2.text=\"4-Dec-2010\" Textbox3.text=\"1-Jan-2011\"

If i have three textboxes in my vb.net webform ..

Textbox1.text="Sumit"

Textbox2.text="4-Dec-2010"

Textbox3.text="1-Jan-2011"

I want if dates selected are in between textbox2 dates and textbox3 dates then textbox1.text="sumit" else tex开发者_高级运维tbox1.text="No dates"


Put the following in your TextChanged method of your textboxes. Set Textbox1.Text = CheckDates().

Function CheckDates
    'Checks to make sure dates were entered'
    If Not IsDate(Textbox2.text) or Not IsDate(Textbox3.text) Then
        Return "No Dates"
        Exit Function
    End If

    If CType(Textbox2.text,Date) >= #12/4/2010# and CType(Textbox3.text,Date) <= #1/1/2011# then
        Return "Submit"
    Else
        Return "No Dates"
    End If
End Function
0

精彩评论

暂无评论...
验证码 换一张
取 消