3 Replies - 159 Views - Last Post: 28 October 2019 - 10:48 AM Rate Topic: -----

#1 JonasK   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 26-April 10

KeyDown problem.

Posted 28 October 2019 - 08:52 AM

On Form1 picturebox. When I click on picbox, dinamicaly open NumericUpDown control.In another click - close. With Form_KeyDown (KeyPreview =True) open other Forms. All work fine.
But when ComPort is open, on another create NumericUpDown and close - KeyDown does not work! The program itself is working fine (read ComPort and display results). What's the problem ? Thank you.
Is This A Good Question/Topic? 0
  • +

Replies To: KeyDown problem.

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15359
  • View blog
  • Posts: 61,583
  • Joined: 12-June 08

Re: KeyDown problem.

Posted 28 October 2019 - 09:13 AM

I am not following. Is this a threading issue where the 'com port' thing is monopolizing the UI thread?
Was This Post Helpful? 0
  • +
  • -

#3 JonasK   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 26-April 10

Re: KeyDown problem.

Posted 28 October 2019 - 10:32 AM

I think so. I do not understand what the connection between these events might be.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15359
  • View blog
  • Posts: 61,583
  • Joined: 12-June 08

Re: KeyDown problem.

Posted 28 October 2019 - 10:48 AM

If it's a threading issue it would be something like the 'com port' part blocking the entire UI thread from happening until the 'com port' is done.

If that's the case it may be worth looking at putting your 'com port' work inside a Task or Thread and seeing if that makes a difference.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1