Solarion
Honorary Master
- Joined
- Nov 14, 2012
- Messages
- 21,886
Here is the scenario I will make it as short as I can.
I have a form with a datagrid and two datetimepickers (fromdate and todate).
When the form shows, I have set the fromdate to start -28 days back, to load data from 28 days ago up to today.
One problem. This:
This horrible thing is calling the
In fact one of my plagues recently has been control events on load.
Any ideas?
I have a form with a datagrid and two datetimepickers (fromdate and todate).
When the form shows, I have set the fromdate to start -28 days back, to load data from 28 days ago up to today.
One problem. This:
Code:
Private Sub SupportLog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dtDateTo.Format = DateTimePickerFormat.Custom
dtDateTo.CustomFormat = "dd, MMMM, yyyy"
dtDateFrom.Format = DateTimePickerFormat.Custom
dtDateFrom.CustomFormat = "dd, MMMM, yyyy"
dtDateTo.MinDate = New DateTime(1985, 6, 20)
[B] dtDateFrom.MaxDate = DateTime.Today[/B]
dtDateFrom.MinDate = New DateTime(1985, 6, 20)
dtDateTo.MaxDate = DateTime.Today
dtDateFrom.Value = DateTime.Today.AddDays(-28)
dtDateTo.Value = DateTime.Today
End Sub
This horrible thing is calling the
event which in turn is pulling all the records on which the control has it's original default before being changed, which is today's date.dtDateFrom.ValueChanged
In fact one of my plagues recently has been control events on load.
Any ideas?
