Skip to content

.NET 4.7 - WPF - ComboBox and ContextMenu click events not fired - Pen does not work reliable with tablets #448

Closed

Description

@Clemani

I have attached a simple test app with one ComboBox and one button with a ContextMenu.
The error happens on Microsoft Surface Pro 4, probably on Surface 3 too. With .NET 4.6.2 it works fine.
I get the error with Windows 10 Creators and with Windows 10 Anniversary/.NET 4.7. I have not tested yet with Windows 8.1/.NET 4.7.

When i click shaky/nervous/hammering with the pen on the ComboBox or Menu, click on the items, move the pen while clicking..... after 5 or 10 minutes the controls stop working:
Then i can open the ComboBox or Menu, can click on an item, the item gets highlighted, but nothing happens: The ComboBox or menu does not close and no click event gets fired.

In "normal" usage in my real app this happens about 5 times per day, very annoying for my users.
You need some "patience" to get the error re-produced, maybe it takes you more than 10 minutes... but it DOES happen.

DotNet47ComboBoxAndMenuError.zip

Also, my app crashes occasionally when .NET 4.7 is installed. I cannot tell when this happens. Maybe this is related to the above issue. Anyway, below are 2 crash events, maybe this helps:

  <Win32_NTLogEvent>
    <Category>100</Category>
      <CategoryString>Application Crashing Events</CategoryString>
      <ComputerName>DESKTOP-XXXXXX</ComputerName>
      <EventCode>1000</EventCode>
      <EventIdentifier>1000</EventIdentifier>
      <EventType>1</EventType>
      <InsertionStrings>MyApp.exe
1.0.61.0
5978bf95
KERNELBASE.dll
10.0.15063.483
aa6457d1
e0434352
0000000000069e08
1430
01d30ad1a24ddd0d
C:\Program Files\MyApp\MyApp.exe
C:\WINDOWS\System32\KERNELBASE.dll
933350d1-c3e2-476a-bf5d-7c17e2383655

</InsertionStrings>
      <Logfile>Application</Logfile>
      <Message>Faulting application name: MyApp.exe, version: 1.0.61.0, time stamp: 0x5978bf95
Faulting module name: KERNELBASE.dll, version: 10.0.15063.483, time stamp: 0xaa6457d1
Exception code: 0xe0434352
Fault offset: 0x0000000000069e08
Faulting process id: 0x1430
Faulting application start time: 0x01d30ad1a24ddd0d
Faulting application path: C:\Program Files\MyApp\MyApp.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 933350d1-c3e2-476a-bf5d-7c17e2383655
Faulting package full name: 
Faulting package-relative application ID: </Message>
      <RecordNumber>251</RecordNumber>
      <SourceName>Application Error</SourceName>
      <TimeGenerated>8/1/2017 2:10:56 PM</TimeGenerated>
      <TimeWritten>8/1/2017 2:10:56 PM</TimeWritten>
      <Type>Error</Type>
    </item>

    <item>
      <Category>0</Category>
      <ComputerName>DESKTOP-XXXXXX</ComputerName>
      <EventCode>1026</EventCode>
      <EventIdentifier>1026</EventIdentifier>
      <EventType>1</EventType>
      <InsertionStrings>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
   at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(System.Windows.Input.RawStylusInputReport)
   at System.Windows.Input.PenContext.FirePackets(Int32, Int32[], Int32)
   at System.Windows.Input.PenThreadWorker.FlushCache(Boolean)
   at System.Windows.Input.PenThreadWorker.FireEvent(System.Windows.Input.PenContext, Int32, Int32, Int32, Int32, IntPtr)
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

</InsertionStrings>
      <Logfile>Application</Logfile>
      <Message>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean)
   at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(System.Windows.Input.RawStylusInputReport)
   at System.Windows.Input.PenContext.FirePackets(Int32, Int32[], Int32)
   at System.Windows.Input.PenThreadWorker.FlushCache(Boolean)
   at System.Windows.Input.PenThreadWorker.FireEvent(System.Windows.Input.PenContext, Int32, Int32, Int32, Int32, IntPtr)
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

</Message>
      <RecordNumber>250</RecordNumber>
      <SourceName>.NET Runtime</SourceName>
      <TimeGenerated>8/1/2017 2:10:56 PM</TimeGenerated>
      <TimeWritten>8/1/2017 2:10:56 PM</TimeWritten>
      <Type>Error</Type>
    </item>
	
	
	
    <item>
      <Category>0</Category>
      <ComputerName>DESKTOP-XXXXXX</ComputerName>
      <EventCode>1026</EventCode>
      <EventIdentifier>1026</EventIdentifier>
      <EventType>1</EventType>
      <InsertionStrings>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TryGetValue(System.__Canon, System.__Canon ByRef)
   at System.Windows.Input.StylusLogic.ProcessInputReport(System.Windows.Input.RawStylusInputReport)
   at System.Windows.Input.PenContext.FirePenOutOfRange(Int32, Int32)
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

</InsertionStrings>
      <Logfile>Application</Logfile>
      <Message>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
   at System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TryGetValue(System.__Canon, System.__Canon ByRef)
   at System.Windows.Input.StylusLogic.ProcessInputReport(System.Windows.Input.RawStylusInputReport)
   at System.Windows.Input.PenContext.FirePenOutOfRange(Int32, Int32)
   at System.Windows.Input.PenThreadWorker.ThreadProc()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

</Message>
      <RecordNumber>534</RecordNumber>
      <SourceName>.NET Runtime</SourceName>
      <TimeGenerated>7/31/2017 1:13:39 PM</TimeGenerated>
      <TimeWritten>7/31/2017 1:13:39 PM</TimeWritten>
      <Type>Error</Type>
    </item>
	
  </Win32_NTLogEvent>

Activity

  1. changed the title [-].NET 4.7 - WPF - ComboBox and ContextMenu - Click on items stops working[/-] [+].NET 4.7 - WPF - ComboBox and ContextMenu - Click on items stops working at some point[/+] on Jul 29, 2017
  2. changed the title [-].NET 4.7 - WPF - ComboBox and ContextMenu - Click on items stops working at some point[/-] [+].NET 4.7 - WPF - ComboBox and ContextMenu click events not fired - Pen does not work reliable with tablets[/+] on Aug 3, 2017
  3. cdipierr commented on Sep 19, 2017

    @cdipierr

    Have you found out anything about this? I'm seeing the same behavior in my app. Eventually comboxes stop responding to stylus input. They still work with mouse when this is the case. I haven't tried your app yet, but the symptoms you're describing are spot on. Devices I'm seeing this on are .NET 4.7 as well. Haven't tried to reproduce in older version just yet.

  4. cdipierr commented on Sep 19, 2017

    @cdipierr

    Tried your app, see same behavior on my device.

  5. Clemani commented on Sep 19, 2017

    @Clemani
    Author
  6. cdipierr commented on Sep 19, 2017

    @cdipierr

    Thanks for the update. I'm a MS Gold partner, so I'm going to open a support incident and see if that can get anything done.

  7. Clemani commented on Sep 19, 2017

    @Clemani
    Author

    Great, i really hope this helps to get the error fixed.
    Please let me know when you have any news on this.

  8. richlander commented on Nov 13, 2017

    @richlander
    Member

    I just sent mail to the team asking for help.

  9. richlander commented on Nov 18, 2017

    @richlander
    Member

    Have you tried installing the November 2017 Update? Please install that and tell me if that helps.

  10. Clemani commented on Nov 20, 2017

    @Clemani
    Author

    Hey, i only need to wait 4 month and voila......
    OK, let's see what the status of the Tablet WPF nightmare (since Creators April) is:

    This issue seems to be solved with .NET 4.7.1 on Windows 10 Anniversary, Creators April and Windows 8.1

    But not in the Creators Fall Update.
    And additionally, the Fall Update has this errors:

    Embedded Chrome browser (WinForms control hosted in WindowsFormsHost):

    o When i click in a text box and press keys on the keyboard nothing happens. Happens when for ex. a Margin is added to the Control at runtime.
    o Click on a combobox item with the Stylus: The dropdown gets closed but the clicked item gets not selected.

    WPF Manipulation:

    Very often, when i want to do a pinch zoom with 2 fingers e.DeltaManipulation.Scale.X and e.DeltaManipulation.Scale.Y is 1.0 ...
    but e.DeltaManipulation.Translation.X or e.DeltaManipulation.Translation.Y is <> 1.0 instead.

    (Also it sometimes takes very long to open for ex. Windows Update, and Drag&Drop from File Explorer to desktop is a pain....)

    I tried the November Cumulative update.

    • It seems to solve my reported error also for .NET 4.7, at least with Creators April.
    • It seems to solve my reported error finally also for the Fall Update.
    • It includes the new Fall Update error (WPF Manipulation), so it happens also on Creators April with .NET 4.7.1 installed
  11. richlander commented on Nov 29, 2017

    @richlander
    Member

    I'm wondering if the best way to make traction here is to close this issue and create new ones with the specific issues you are still seeing. There are multiple issues outlined here that don't see related. Fair Clemani ?

  12. Clemani commented on Nov 29, 2017

    @Clemani
    Author

    Yes, this makes sense.... but only if MS staff is then really at least checking the issues within a few weeks and gives a response on whether they can re-produce the issue or not and whether they will fix it.
    And note: Most errors happen not with simple standard controls (at least i was not able to make a "simple" test app to reproduce the errors)... I would need to upload a sample app with mentioned embedded Chrome browser... my concern is that i spend much time on this and MS says then "not our error, the error must be in the embedded chrome browser"... if i get a response at all... my experience on reporting errors to MS is BAD.... you may have noticed my partially offending, destructive comments.... that's because i am really frustrated about the errors, how MS deals with reported errors, how they even bundle errors into Cumulative updates. I think i spent 30% of my working time with dealing with these errors in the last 6 month.

    If you honestly can say, "yes i will check the issues".... then i create new issues here.

  13. richlander commented on Nov 29, 2017

    @richlander
    Member

    I just responded back! Yes, I'll look back to address your issues.

    Feel free to reach out directly to me at rlander@ms, too.

  14. richlander commented on Nov 29, 2017

    @richlander
    Member

    Closing since we agreed we're no longer going to use this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions