Page 1 of 1

Setfocus Problem in Textbox

Posted: Tue Dec 08, 2009 3:21 pm
by sudip
Hello All,

I am now coming again with another query ;) Sorry, but I can't help myself to stop asking you again and again :)

Description of my problem is as follows:

In my entry form I have some tool buttons eg., Add, Modify, Delete etc. I also have 2 buttons Save and Cancel, which are initially disabled. There are also some textboxes (or comboboxes) which are initially disabled. Now, when the user clicks on Add button (toolbar button), toolbar becomes disabled and Save, Cancel enabled, Textboxes (and Comboboxes) become enabled. And first textbox gets the focus. It runs fine when user clicks on Add button it runs fine, but when user uses keyboard (Alt+A) everything is ok, but the cursor at the textbox is not blinking. User has to press another key to make it blinking and type. If you want I shall make a small sample for this. In the meantime my old project can show you the problem.
MyExpense.jpg
MyExpense.jpg (29.66 KiB) Viewed 2378 times
Please download download/file.php?id=382 and compile. Then please open Expense Head Setup form and try to add using both Mouse and Keyboard (please check ExpMst.prg)

Code: Select all

static PROCEDURE ActivateEdit
   frmExp.Grid_1.Enabled  := .f.
   frmExp.txtSearch.Enabled := .f.
   frmExp.txtExpnm.enabled := .t.
   frmExp.txtAmt.enabled := .t.
   frmExp.txtRem.enabled := .t.

   frmExp.cmdSave.Enabled      := .t.
   frmExp.cmdCancel.Enabled      := .t.
   frmExp.ToolBar_1.Enabled      := .f.
   frmExp.txtExpnm.SetFocus
   RETURN
Thanks in advance.

With best regards.

Sudip

Re: Setfocus Problem in Textbox

Posted: Tue Dec 08, 2009 4:28 pm
by Roberto Lopez
sudip wrote:Hello All,

I am now coming again with another query ;) Sorry, but I can't help myself to stop asking you again and again :)
The cursor on the textbox appears for me clicking the 'add' button or doing alt+a.

I've tested with 3.0 (test XII) and Windows 7.

Re: Setfocus Problem in Textbox

Posted: Tue Dec 08, 2009 5:02 pm
by sudip
Roberto Lopez wrote: The cursor on the textbox appears for me clicking the 'add' button or doing alt+a.
I've tested with 3.0 (test XII) and Windows 7.
Hello Master Roberto,
Thanks a lot for your reply.
After pressing Alt+A, cursor in the textbox blinks or stands still? In my computer it appears but stands still.
I am using HMG 3.0.0 Test XII and Win XP SP 2.
With best regards.
Sudip

Re: Setfocus Problem in Textbox

Posted: Tue Dec 08, 2009 6:25 pm
by Roberto Lopez
sudip wrote:
Roberto Lopez wrote: The cursor on the textbox appears for me clicking the 'add' button or doing alt+a.
I've tested with 3.0 (test XII) and Windows 7.
Hello Master Roberto,
Thanks a lot for your reply.
After pressing Alt+A, cursor in the textbox blinks or stands still? In my computer it appears but stands still.
I am using HMG 3.0.0 Test XII and Win XP SP 2.
With best regards.
Sudip
Yes. The cursor do not blink when activate with alt+a, but the textbox has the focus and typing a character are correctly received by it.

Re: Setfocus Problem in Textbox

Posted: Wed Dec 09, 2009 2:13 pm
by sudip
Roberto Lopez wrote: Yes. The cursor do not blink when activate with alt+a, but the textbox has the focus and typing a character are correctly received by it.
Hello Master Roberto,
Thanks a lot for reply.
If possible can you please test following (in your time :) ) :
Open Expense Head Setup form and press Alt+A (as before) then press SPACEBAR. In my case it opens child windows menu as follows (but when I click on "Add" button it works as usual)
SetFocus.jpg
SetFocus.jpg (28.35 KiB) Viewed 2332 times
Thanks in advance.
With best regards.
Sudip

Re: Setfocus Problem in Textbox

Posted: Thu Dec 10, 2009 2:17 am
by Roberto Lopez
sudip wrote: If possible can you please test following (in your time :) ) :
Open Expense Head Setup form and press Alt+A (as before) then press SPACEBAR. In my case it opens child windows menu as follows (but when I click on "Add" button it works as usual)
I'll do. It is surely another symptom of the same problem.