OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: aoxiangzcr on December 12, 2007, 03:57:19 AM

Title: A problem about combobox,textbox and grid
Post by: 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
Title: Re: A problem about combobox,textbox and grid
Post by: Kelie on December 12, 2007, 08:29:35 AM
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.
Title: Re: A problem about combobox,textbox and grid
Post by: aoxiangzcr on December 12, 2007, 06:22:52 PM
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?
Title: Re: A problem about combobox,textbox and grid
Post by: Kelie on December 12, 2007, 09:23:58 PM
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.
Title: Re: A problem about combobox,textbox and grid
Post by: owenwengerd on December 12, 2007, 09:44:13 PM
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.
Title: Re: A problem about combobox,textbox and grid
Post by: aoxiangzcr on December 13, 2007, 05:51:10 AM
Can you give me a example? thanks.
Title: Re: A problem about combobox,textbox and grid
Post by: owenwengerd on December 13, 2007, 09:10:29 AM
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.
Title: Re: A problem about combobox,textbox and grid
Post by: aoxiangzcr on December 13, 2007, 06:09:18 PM
I will try it again by myself,by the way,thank you.
Title: Re: A problem about combobox,textbox and grid
Post by: 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!
Title: Re: A problem about combobox,textbox and grid
Post by: BazzaCAD on December 13, 2007, 11:31:31 PM
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))
Title: Re: A problem about combobox,textbox and grid
Post by: JTHWAMAN on January 14, 2008, 05:17:25 AM
How utilizes (dcl_GetFocus)?
May provide the model?
Thanks~