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
Quote from: aoxiangzcr on December 12, 2007, 03:57:19 AM
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.
Quote from: Kelie on December 12, 2007, 08:29:35 AM
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?
Quote from: aoxiangzcr on December 12, 2007, 06:22:52 PM
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.
Quote from: aoxiangzcr on December 12, 2007, 03:57:19 AM
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.
Quote from: aoxiangzcr on December 13, 2007, 05:51:10 AM
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.
Quote from: owenwengerd on December 12, 2007, 09:44:13 PM
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!
Quote from: Kelie on December 13, 2007, 09:09:25 PM
Quote from: owenwengerd on December 12, 2007, 09:44:13 PM
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~