PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

DateTimePicker - changes the value value "back" when right clickingoutside the component

 
 
Sonnich Jensen
Guest
Posts: n/a
 
      28th Dec 2011
Hi

I have a problem with the DateTimePicker.

1) i open the drop down
2) step months back/forth
3) while the drop down is open, move the mouse to some (any) other
point and right click

At this moment the DateTimePicker will fire the "value changed" event
with the original values, then the "CloseUp" event.

This is a problem, as the right click is used our app.

Any way to avoid this? And why does this happen anyway?

Sonnich
 
Reply With Quote
 
 
 
 
Registered User
Guest
Posts: n/a
 
      28th Dec 2011
On Wed, 28 Dec 2011 04:21:41 -0800 (PST), Sonnich Jensen
<(E-Mail Removed)> wrote:

>Hi
>
>I have a problem with the DateTimePicker.
>

I've tried to replicate this behavior using a forms app in VS2010 with
the .NET 4 client profile. What I found was

>1) i open the drop down
>2) step months back/forth


moving month to month fires the control's ValueChanged event. This is
appropriate as the selected value changes with the month.

>3) while the drop down is open, move the mouse to some (any) other
>point and right click
>

Right-clicking within the dropdown presents a context menu with the
single selection "Go to today".

>At this moment the DateTimePicker will fire the "value changed" event
>with the original values, then the "CloseUp" event.
>
>This is a problem, as the right click is used our app.
>
>Any way to avoid this? And why does this happen anyway?
>

I am unable to reproduce the problem as described so I can offer no
insights.

One question : Is it necessary to use the control as a drop-down? With
the ShowUpDown property set to true, a selection can be made using a
spinbutton instead of the dropdown calendar.

regards
A.G.
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      29th Dec 2011
On Dec 28, 3:51*pm, Registered User <n4...@ix.netcom.com> wrote:
> On Wed, 28 Dec 2011 04:21:41 -0800 (PST), Sonnich Jensen
>
> <sonnichjen...@gmail.com> wrote:
> >Hi

>
> >I have a problem with the DateTimePicker.

>
> I've tried to replicate this behavior using a forms app in VS2010 with
> the .NET 4 client profile. What I found was
>
> >1) i open the drop down
> >2) step months back/forth

>
> moving month to month fires the control's ValueChanged event. This is
> appropriate as the selected value changes with the month.
>
> >3) while the drop down is open, move the mouse to some (any) other
> >point and right click



When the drop down is open, move to a "component free" place on the
form/panel , and right click there

I have VS2008 and run it on XP (.net 3.5)

Sonnich


>
> Right-clicking within the dropdown presents a context menu with the
> single selection "Go to today".
>
> >At this moment the DateTimePicker will fire the "value changed" event
> >with the original values, then the "CloseUp" event.

>
> >This is a problem, as the right click is used our app.

>
> >Any way to avoid this? And why does this happen anyway?

>
> I am unable to reproduce the problem as described so I can offer no
> insights.
>
> One question : Is it necessary to use the control as a drop-down? With
> the ShowUpDown property set to true, a selection can be made using a
> spinbutton instead of the dropdown calendar.


For the ranges and system we use, I guess it is. I will check this
feature tomorrow at work,



>
> regards
> A.G.


 
Reply With Quote
 
Registered User
Guest
Posts: n/a
 
      29th Dec 2011
On Wed, 28 Dec 2011 16:00:32 -0800 (PST), Sonnich Jensen
<(E-Mail Removed)> wrote:

>On Dec 28, 3:51*pm, Registered User <n4...@ix.netcom.com> wrote:
>> On Wed, 28 Dec 2011 04:21:41 -0800 (PST), Sonnich Jensen
>>
>> <sonnichjen...@gmail.com> wrote:
>> >Hi

>>
>> >I have a problem with the DateTimePicker.

>>
>> I've tried to replicate this behavior using a forms app in VS2010 with
>> the .NET 4 client profile. What I found was
>>
>> >1) i open the drop down
>> >2) step months back/forth

>>
>> moving month to month fires the control's ValueChanged event. This is
>> appropriate as the selected value changes with the month.
>>
>> >3) while the drop down is open, move the mouse to some (any) other
>> >point and right click

>
>
>When the drop down is open, move to a "component free" place on the
>form/panel , and right click there
>

I don't see any unexpected behavior. Clicking outside of the control
simply changes the scope/focus and the dropdown closes. The
ValueChanged event does not fire when that happens.
- snip -
>> I am unable to reproduce the problem as described so I can offer no
>> insights.
>>
>> One question : Is it necessary to use the control as a drop-down? With
>> the ShowUpDown property set to true, a selection can be made using a
>> spinbutton instead of the dropdown calendar.

>
>For the ranges and system we use, I guess it is. I will check this
>feature tomorrow at work,
>

As long as the dropdown calendar is not a must have, the spinbutton
should work fine business.

regards
A.G.
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      29th Dec 2011
On Dec 29, 3:04*am, Registered User <n4...@ix.netcom.com> wrote:
> On Wed, 28 Dec 2011 16:00:32 -0800 (PST), Sonnich Jensen
>
>
>
>
>
>
>
>
>
> <sonnichjen...@gmail.com> wrote:
> >On Dec 28, 3:51*pm, Registered User <n4...@ix.netcom.com> wrote:
> >> On Wed, 28 Dec 2011 04:21:41 -0800 (PST), Sonnich Jensen

>
> >> <sonnichjen...@gmail.com> wrote:
> >> >Hi

>
> >> >I have a problem with the DateTimePicker.

>
> >> I've tried to replicate this behavior using a forms app in VS2010 with
> >> the .NET 4 client profile. What I found was

>
> >> >1) i open the drop down
> >> >2) step months back/forth

>
> >> moving month to month fires the control's ValueChanged event. This is
> >> appropriate as the selected value changes with the month.

>
> >> >3) while the drop down is open, move the mouse to some (any) other
> >> >point and right click

>
> >When the drop down is open, move to a "component free" place on the
> >form/panel , and right click there

>
> I don't see any unexpected behavior. Clicking outside of the control
> simply changes the scope/focus and the dropdown closes. The
> ValueChanged event does not fire when that happens.


In my case it does - here is my log (with comments):

29.12.2011 12:21:16.096 ------started--------
29.12.2011 12:21:17.218 enter [got focus]
29.12.2011 12:21:17.729 dtpErrorStart_MouseLeave [this means going to
the drop down window, which appreantly is not a part of the
DateTimePicker]
29.12.2011 12:21:18.810 dtpErrorEnd_ValueChanged: False, 29.11.2011
12:21:16 - 29.12.2011 12:21:16 [stepping in the calendar]
29.12.2011 12:21:19.151 dtpErrorEnd_ValueChanged: False, 29.10.2011
12:21:16 - 29.12.2011 12:21:16 [stepping in the calendar]
29.12.2011 12:21:19.662 dtpErrorEnd_ValueChanged: False, 29.09.2011
12:21:16 - 29.12.2011 12:21:16 [stepping in the calendar]
29.12.2011 12:21:20.192 dtpErrorEnd_ValueChanged: False, 29.08.2011
12:21:16 - 29.12.2011 12:21:16 [stepping in the calendar]
[here I move the mouse to the side, and it is on the form]
29.12.2011 12:21:21.454 dtpErrorEnd_ValueChanged: False, 29.12.2011
12:21:16 - 29.12.2011 12:21:16 [****this comes when I right click
on the form****]
29.12.2011 12:21:21.454 dtpErrorStart_CloseUp

dtpErrorEnd and Start uses the same "value changed". When one of them
changes I rerun my query. All event are from the same component.

Once again, this is VS2008, NET3.5 on Win XP
The ValueChanged with the original time does not come when I left
click.

Sonnich





> - snip ->> I am unable to reproduce the problem as described so I can offer no
> >> insights.

>
> >> One question : Is it necessary to use the control as a drop-down? With
> >> the ShowUpDown property set to true, a selection can be made using a
> >> spinbutton instead of the dropdown calendar.

>
> >For the ranges and system we use, I guess it is. I will check this
> >feature tomorrow at work,

>
> As long as the dropdown calendar is not a must have, the spinbutton
> should work fine business.
>
> regards
> A.G.


 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      29th Dec 2011
On Dec 29, 12:40*pm, Sonnich Jensen <sonnichjen...@gmail.com> wrote:
> On Dec 29, 3:04*am, Registered User <n4...@ix.netcom.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Wed, 28 Dec 2011 16:00:32 -0800 (PST), Sonnich Jensen

>
> > <sonnichjen...@gmail.com> wrote:
> > >On Dec 28, 3:51*pm, Registered User <n4...@ix.netcom.com> wrote:
> > >> On Wed, 28 Dec 2011 04:21:41 -0800 (PST), Sonnich Jensen

>
> > >> <sonnichjen...@gmail.com> wrote:
> > >> >Hi

>
> > >> >I have a problem with the DateTimePicker.

>
> > >> I've tried to replicate this behavior using a forms app in VS2010 with
> > >> the .NET 4 client profile. What I found was

>
> > >> >1) i open the drop down
> > >> >2) step months back/forth

>
> > >> moving month to month fires the control's ValueChanged event. This is
> > >> appropriate as the selected value changes with the month.

>
> > >> >3) while the drop down is open, move the mouse to some (any) other
> > >> >point and right click

>
> > >When the drop down is open, move to a "component free" place on the
> > >form/panel , and right click there

>
> > I don't see any unexpected behavior. Clicking outside of the control
> > simply changes the scope/focus and the dropdown closes. The
> > ValueChanged event does not fire when that happens.

>
> In my case it does - here is my log (with comments):
>
> 29.12.2011 12:21:16.096 ------started--------
> 29.12.2011 12:21:17.218 enter * [got focus]
> 29.12.2011 12:21:17.729 dtpErrorStart_MouseLeave *[this means going to
> the drop down window, which appreantly is not a part of the
> DateTimePicker]
> 29.12.2011 12:21:18.810 dtpErrorEnd_ValueChanged: False, 29.11.2011
> 12:21:16 - 29.12.2011 12:21:16 * [stepping in the calendar]
> 29.12.2011 12:21:19.151 dtpErrorEnd_ValueChanged: False, 29.10.2011
> 12:21:16 - 29.12.2011 12:21:16 * [stepping in the calendar]
> 29.12.2011 12:21:19.662 dtpErrorEnd_ValueChanged: False, 29.09.2011
> 12:21:16 - 29.12.2011 12:21:16 * [stepping in the calendar]
> 29.12.2011 12:21:20.192 dtpErrorEnd_ValueChanged: False, 29.08.2011
> 12:21:16 - 29.12.2011 12:21:16 * [stepping in the calendar]
> [here I move the mouse to the side, and it is on the form]
> 29.12.2011 12:21:21.454 dtpErrorEnd_ValueChanged: False, 29.12.2011
> 12:21:16 - 29.12.2011 12:21:16 * *[****this comes when I right click
> on the form****]
> 29.12.2011 12:21:21.454 dtpErrorStart_CloseUp
>
> dtpErrorEnd and Start uses the same "value changed". When one of them
> changes I rerun my query. All event are from the same component.
>
> Once again, this is VS2008, NET3.5 on Win XP
> The ValueChanged with the original time does not come when I left
> click.
>
> Sonnich


This action make me think, it is like it is a way of cancelling the
selection, but that is not the case - it is funny, that the Validating
event comes before the ValueChanged event....


29.12.2011 18:50:47.012 dtpErrorStart_MouseLeave
29.12.2011 18:50:47.633 dtpErrorEnd_ValueChanged: False, 29.11.2011
18:50:45 - 29.12.2011 18:50:45
29.12.2011 18:50:48.024 dtpErrorEnd_ValueChanged: False, 29.10.2011
18:50:45 - 29.12.2011 18:50:45
29.12.2011 18:50:48.394 dtpErrorEnd_ValueChanged: False, 29.09.2011
18:50:45 - 29.12.2011 18:50:45
29.12.2011 18:50:48.795 dtpErrorEnd_ValueChanged: False, 29.08.2011
18:50:45 - 29.12.2011 18:50:45
29.12.2011 18:50:54.583 dtpErrorEnd_ValueChanged: False, 29.12.2011
18:50:45 - 29.12.2011 18:50:45
29.12.2011 18:50:54.603 dtpErrorStart_CloseUp
29.12.2011 18:51:02.024 dtpErrorStart_Validating: False (<e.Cancel)
29.12.2011 18:51:02.024 dtpErrorStart_Validated



>
>
>
>
>
>
>
> > - snip ->> I am unable to reproduce the problem as described so I can offer no
> > >> insights.

>
> > >> One question : Is it necessary to use the control as a drop-down? With
> > >> the ShowUpDown property set to true, a selection can be made using a
> > >> spinbutton instead of the dropdown calendar.

>
> > >For the ranges and system we use, I guess it is. I will check this
> > >feature tomorrow at work,

>
> > As long as the dropdown calendar is not a must have, the spinbutton
> > should work fine business.


The design is requested so

>
> > regards
> > A.G.


 
Reply With Quote
 
Registered User
Guest
Posts: n/a
 
      29th Dec 2011
On Thu, 29 Dec 2011 08:56:22 -0800 (PST), Sonnich Jensen
<(E-Mail Removed)> wrote:

>On Dec 29, 12:40*pm, Sonnich Jensen <sonnichjen...@gmail.com> wrote:
>> On Dec 29, 3:04*am, Registered User <n4...@ix.netcom.com> wrote:
>>

-snip -
>>
>> > I don't see any unexpected behavior. Clicking outside of the control
>> > simply changes the scope/focus and the dropdown closes. The
>> > ValueChanged event does not fire when that happens.

>>
>> In my case it does - here is my log (with comments):
>>
>> 29.12.2011 12:21:16.096 ------started--------
>> 29.12.2011 12:21:17.218 enter * [got focus]
>> 29.12.2011 12:21:17.729 dtpErrorStart_MouseLeave *[this means going to
>> the drop down window, which appreantly is not a part of the
>> DateTimePicker]

- snip -
>
>This action make me think, it is like it is a way of cancelling the
>selection, but that is not the case - it is funny, that the Validating
>event comes before the ValueChanged event....
>

-snip-
>The design is requested so
>

It is very likely the unexpected behavior you describe is a
side-effect of the design. Create a forms app, drop a DateTimePicker
control on the form, and run the app. Compare how the control behaves
in the simple app versus the app you're working on. That should
demonstrate where the problem isn't.

regards
A.G.
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      30th Dec 2011
On Dec 29, 7:35*pm, Registered User <n4...@ix.netcom.com> wrote:
> On Thu, 29 Dec 2011 08:56:22 -0800 (PST), Sonnich Jensen
>
>
>
>
>
>
>
>
>
> <sonnichjen...@gmail.com> wrote:
> >On Dec 29, 12:40*pm, Sonnich Jensen <sonnichjen...@gmail.com> wrote:
> >> On Dec 29, 3:04*am, Registered User <n4...@ix.netcom.com> wrote:

>
> -snip -
>
> >> > I don't see any unexpected behavior. Clicking outside of the control
> >> > simply changes the scope/focus and the dropdown closes. The
> >> > ValueChanged event does not fire when that happens.

>
> >> In my case it does - here is my log (with comments):

>
> >> 29.12.2011 12:21:16.096 ------started--------
> >> 29.12.2011 12:21:17.218 enter * [got focus]
> >> 29.12.2011 12:21:17.729 dtpErrorStart_MouseLeave *[this means going to
> >> the drop down window, which appreantly is not a part of the
> >> DateTimePicker]

> - snip -
>
> >This action make me think, it is like it is a way of cancelling the
> >selection, but that is not the case - it is funny, that the Validating
> >event comes before the ValueChanged event....

>
> -snip-
> >The design is requested so

>
> It is very likely the unexpected behavior you describe is a
> side-effect of the design. Create a forms app, drop a DateTimePicker
> control on the form, and run the app. Compare how the control behaves
> in the simple app versus the app you're working on. That should
> demonstrate where the problem isn't.


Well, the problem remain. Just the component itself does this, with a
form and the component. Right clicking on the form when the drop down
is open cause the same - the DTP returns to it original value
Try it yourself

Sonnich
 
Reply With Quote
 
Registered User
Guest
Posts: n/a
 
      30th Dec 2011
On Fri, 30 Dec 2011 01:29:48 -0800 (PST), Sonnich Jensen
<(E-Mail Removed)> wrote:

- much snippage -
>
>Well, the problem remain. Just the component itself does this, with a
>form and the component. Right clicking on the form when the drop down
>is open cause the same - the DTP returns to it original value
>Try it yourself
>

I have tried it. Previously in this thread I described the control's
behavior as being nothing similar to what you're experiencing. A
right-click on the DateTimePicker's dropdown displays a context menu.

When you tried it, was it in a new forms app or just in an empty form
in your app? I suspect the latter because in the original post it was
written

- quote -
This is a problem, as the right click is used our app.
- end quote -

One thing to note is the control does not expose its MouseClick event.
This makes sense because on the dropdown a left-click indicates a
selection while a right-click brings up a built-in context menu.

All this leads me to believe that somewhere in the application mouse
messages are being hooked in order to promote the app's right click
behavior. This would explain the unexpected behavior of the
DateTimePicker control.

regards
A.G.
 
Reply With Quote
 
Sonnich Jensen
Guest
Posts: n/a
 
      30th Dec 2011
On Dec 30, 3:09*pm, Registered User <n4...@ix.netcom.com> wrote:
> On Fri, 30 Dec 2011 01:29:48 -0800 (PST), Sonnich Jensen
>
> <sonnichjen...@gmail.com> wrote:
>
> - much snippage -
>
> >Well, the problem remain. Just the component itself does this, with a
> >form and the component. Right clicking on the form when the drop down
> >is open cause the same - the DTP returns to it original value
> >Try it yourself

>
> I have tried it. Previously in this thread I described the control's
> behavior as being nothing similar to what you're experiencing. A
> right-click on the DateTimePicker's dropdown displays a context menu.


not on the drop down, but OUTSIDE the DTP - click on the form itself
then the date turns back to the original

I see the context menu too (select today)

>
> When you tried it, was it in a new forms app or just in an empty form
> in your app? I suspect the latter because in the original post it was
> written


that is what I am doing now

>
> - quote -
> * * * * This is a problem, as the right click is used our app.
> - end quote -
>
> One thing to note is the control does not expose its MouseClick event.
> This makes sense because on the dropdown a left-click indicates a
> selection while a right-click brings up a built-in context menu.
>
> All this leads me to believe that somewhere in the application mouse
> messages are being hooked in order to promote the app's right click
> behavior. This would explain the unexpected behavior of the
> DateTimePicker control.
>
> regards
> A.G.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 AM.