Hi everyone,
I've a textbox in which, when the DoubleClick event is calling, I control if the user has wrote a normal text (e.g. 'BUSINESS') or a date (e.g. 23/01/2007). in this last case I open a monthCalendar object and the user could select the new date.
Which method/event of this object I have to modify (I think DateChanged or DateSelected) in order to have in the textbox the date I've selected (this part is not a problem....I only need the best event where put the code in) and, after this operation, make a dispose of MonthCalendar object???
I tried this (oDt is the MonthCalendar Object and field1 the textbox where I want to put my date):
but Vb returns me an error which sounds like it's impossibile to call an object which was deletedCode:Private Sub oDt_DateSelected(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles oDt.DateSelected Me.field1.Text = oDt.SelectionStart.Date.ToShortDateString oDt.Dispose() End Sub
Thank you in advance...




Reply With Quote