A problem about combobox,textbox and grid

Started by aoxiangzcr · 2007-12-12 11:57 UTC · 10 replies · SMF topic #113

Hello, everyone.I have a problem about combobox,textbox and grid.When the focs in these control,I press the "Enter" Key,the form closed.My problem is that how can I catch the "Enter" key?And What can I do about it ?
Regards,
Aoxiangzcr
author=aoxiangzcr link=topic=113.msg454#msg454 date=1197460639 wrote:
Hello, everyone.I have a problem about combobox,textbox and grid.When the focs in these control,I press the "Enter" Key,the form closed.My problem is that how can I catch the "Enter" key?And What can I do about it ?
Regards,
Aoxiangzcr


Try setting the "ReturnAsTab" property to True.
author=Kelie link=topic=113.msg456#msg456 date=1197476975 wrote:
Try setting the "ReturnAsTab" property to True.

At first ,thank you,Kelie.I try your said,and I have solved the problem about combobox and textbox.But the same problem about Grid have not be solved.Is there any way alse I can test?
author=aoxiangzcr link=topic=113.msg463#msg463 date=1197512572 wrote:
At first ,thank you,Kelie.I try your said,and I have solved the problem about combobox and textbox.But the same problem about Grid have not be solved.Is there any way alse I can test?


i haven't used grid from OpenDCL myself. hopefully someone else with experience can help you. btw, you're welcome.
author=aoxiangzcr link=topic=113.msg454#msg454 date=1197460639 wrote:
My problem is that how can I catch the "Enter" key?And What can I do about it ?


I think the best way to deal with this is to handle the OnCancelClose event for the form, and return T to prevent the form from closing if the focus is on one of the controls you're concerned with.
Can you give me a example? thanks.
author=aoxiangzcr link=topic=113.msg466#msg466 date=1197553870 wrote:
Can you give me a example? thanks.


Sorry, I don't have one handy.
I will try it again by myself,by the way,thank you.
author=owenwengerd link=topic=113.msg465#msg465 date=1197524653 wrote:
I think the best way to deal with this is to handle the OnCancelClose event for the form, and return T to prevent the form from closing if the focus is on one of the controls you're concerned with.


Owen,

Is there a function in OpenDCL that can determine which control currently has the focus?

Thanks!
author=Kelie link=topic=113.msg470#msg470 date=1197608965 wrote:
[quote author=owenwengerd link=topic=113.msg465#msg465 date=1197524653]
I think the best way to deal with this is to handle the OnCancelClose event for the form, and return T to prevent the form from closing if the focus is on one of the controls you're concerned with.


Owen,

Is there a function in OpenDCL that can determine which control currently has the focus?

Thanks!


Here ya go...

Method GetFocus as List of Strings

This method will return a list indicating the project name, dialog box name and the name of the control that has the current focus. If the control name is blank then the dialog box has the focus.

AutoLISP Syntax:
(Setq rValue (dcl_GetFocus))
How utilizes (dcl_GetFocus)?
May provide the model?
Thanks~