5 Replies - 922 Views - Last Post: 09 August 2013 - 05:58 PM Rate Topic: -----

#1 jctgt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 08-August 13

Programme freeze while hitting on tab key at run time

Posted 08 August 2013 - 05:35 PM

Hi,

How can I detect this tab key as well as other keys as ESC? (To prevent the freeze)

If a user hit the tab key by error instead of CapsLock below, the progamme freeze completely and I have to cut the power and restart the computer.

Thanks,
Is This A Good Question/Topic? 0
  • +

Replies To: Programme freeze while hitting on tab key at run time

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9195
  • View blog
  • Posts: 34,523
  • Joined: 12-June 08

Re: Programme freeze while hitting on tab key at run time

Posted 08 August 2013 - 05:40 PM

Have you ran this program in your IDE of choice? Threw some breakpoints around where you read key inputs? Checked to see what was happening?
Was This Post Helpful? 0
  • +
  • -

#3 jctgt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 08-August 13

Re: Programme freeze while hitting on tab key at run time

Posted 08 August 2013 - 06:42 PM

Hi modi123_1 ,

Thanks for your help.

Yes I ran this program in IDE of choice. I puta breakpoint to the first line of the textbox that is SetFocus.
While hitting any letters or figures it stop at the breakpoint but if I hit the tab key, the texbox lost focus, nothing happen and I have to restart the programme, losing the previous work.

If I hit other keys as ESC, the F1 to F12, etc, the txtbox do'nt lost focus but do'nt stop at the breakpoint.
Was This Post Helpful? 0
  • +
  • -

#4 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,281
  • Joined: 28-March 11

Re: Programme freeze while hitting on tab key at run time

Posted 08 August 2013 - 06:44 PM

Your going to have to post your code in order to get help on this...
Was This Post Helpful? 0
  • +
  • -

#5 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: Programme freeze while hitting on tab key at run time

Posted 09 August 2013 - 02:54 AM

As mentioned by others, you'll need to post some code, specifically around the event handlers of your textboxes.

Pressing tab shouldn't really have any other effect other than moving to the next control in the tab order.

You also need to confirm whether this is VB6 or VB.Net, so that you can get a better response to your questions.
Was This Post Helpful? 0
  • +
  • -

#6 jctgt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 08-August 13

Re: Programme freeze while hitting on tab key at run time

Posted 09 August 2013 - 05:58 PM

Hi,

I solved my problem. Here's how:

I created a variant As Boolean.

Private Sub textbox_GotFocus()
variant = True
End Sub

I hit the Tab Key, so the textbox.lostfocus

Private Sub textbox_LostFocus()
If variant = True Then textbox.SetFocus
End Sub

Private Sub textbox_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case Is = 13
variant = False
End Select
End Sub


THANKS!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1