-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: thajeer
Message 10 in Discussion



Dude,

        You
cant set the focus using code ... (you can , but not useful in this scenario
) 

        you
change date .. then press a tab .. then the validating event will be fired
. 

I dont know if this will suit your purpose
, but isnt always better to get another input from the user before u do
some actions based on a datechange .. like a button click .. 





and if you dont want the user to change
anything .. here is another solution but messy .. 

two events are used close up ( marks
the close of dropdown) and text changed .. will work .. but go for a button
, if you dont have a requirement other wise .. 





    Private
Sub
dtpShipmentDate_CloseUp(ByVal
sender As
Object,
ByVal
e As
System.EventArgs) Handles
dtpShipmentDate.CloseUp

        accessSomeDate()

    End
Sub



    Private
Sub
dtpShipmentDate_TextChanged(ByVal
sender As
Object,
ByVal
e As
System.EventArgs) Handles
dtpShipmentDate.TextChanged

        accessSomeDate()

    End
Sub



    Private
Sub
accessSomeDate()

        Try

         
  Static
dtOlDate As
DateTime = dtpShipmentDate.MinDate

         
  If
dtOlDate.CompareTo(dtpShipmentDate.Value) = 0 Then
Exit
Try

         
  dtOlDate = dtpShipmentDate.Value

         
  Dim
strShipmentDate As
String

         
  Dim
dtShipmentDate As
DateTime

         
  Dim
drPartsSupplier As
DataRow

         
  dtShipmentDate = dtpShipmentDate.Value.Date

         
  strShipmentDate = dtShipmentDate.ToString("dd/MM/yyyy")

         
  MsgBox(dtpShipmentDate.Value)

        Catch
ex As
Exception

         
  MessageBox.Show("Error while getting the Data" & ex.Message)

        End
Try

    End
Sub



Thats all I have .. 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to