שתף באמצעות


Cursor is not display while textbox has focus

Question

Thursday, December 3, 2015 12:38 PM

Hi i am write some case

make one program

that has textbox run it and move focus to textbox by pressing Mouse. So textbox get focus and cursor is display in textbox.

Now you press window key from keyboard then start menu is open.

then press ESC key then Start menu Closed. Now you see where is focus. Now textbox has focus but cursor is not display in textbox

If Any One give solution regarding This

Thank You very much in advance

All replies (11)

Friday, December 4, 2015 1:24 PM ✅Answered

I did exactly as you said. 

If the Windows Menu shows up, the caret (cursor) is not anymore in the textbox.

After Esc it blinks again 

Therefore there must be something else what causes your problem. Did you make that case by yourself by the way?

Success
Cor


Thursday, December 3, 2015 12:44 PM

After pressing the ESC key and then clicking the form my system has the caret cursor blinking in the text box.

Are you clicking the form to return focus to the form?


Thursday, December 3, 2015 12:46 PM

The focus is not on your textbox when you close the start menu, in fact it is not even on your application.

I think you will find that applies to all applications and there is little you can do about it.


Friday, December 4, 2015 9:21 AM

i have one case i have form which has textbox.And Client is continuesly scan barcode. But some time it is stop scan barcode and then client must select form. then it is continuesly scan barcode


Friday, December 4, 2015 10:28 AM

What presentation technology are you using, this sounds to a webpage?

Windows Forms, WPF, Web?

Success
Cor


Friday, December 4, 2015 12:24 PM

Win Forms Technology


Friday, December 4, 2015 12:39 PM

If the reading of the barcode stops just because your form loses focus then there is something wrong with the way you are reading the barcode.


Friday, December 4, 2015 12:58 PM

write but i want focus back without using timer


Friday, December 4, 2015 12:59 PM

Here is no attachment

so i can't give u vedio

give me mail id so i can give u vedio


Friday, December 4, 2015 1:15 PM

If the reading of the barcode stops just because your form loses focus then there is something wrong with the way you are reading the barcode.

 Most usb type BarCode scanners usually act like a keyboard as in they just simulate keys being pressed so,  if another application/process takes focus,  the keys would be sent to that instead. Similar to using SendKeys, the app/control you want them sent to has to have focus.

 The application would need to be made so it can not loose focus or at least so that it can set focus back to itself as soon as it detects loosing focus.  That would not be 100% reliable though.  Perhaps there is a way to hook into the HID device to detect activity.

 Without testing,  maybe even a keyboard hook could detect specific characters and report them through an event back to the form/textbox.

 Of coarse,  the best way to do it would depend on if ankit wants to be able to navigate through other apps while this app is running.   8)

If you say it can`t be done then i`ll try it


Friday, December 4, 2015 1:38 PM

 Most usb type BarCode scanners usually act like a keyboard as in they just simulate keys being pressed so

Really? - so whilst developing the app if you wanted to run a barcode reader simulator on the same pc for testing you couldn't easily do so.

I've only done one barcode application and that used a serial port which is probably why I don't remember seeing this problem.