PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: gian young on May 29, 2005, 10:22:02 PM

Title: How to use the Edit Box in a ComboBox
Post by: gian young on May 29, 2005, 10:22:02 PM
Hi,

I am using a Combobox Control in FireFly with the CBS_DROPDOWN Style, this style allows me to Edit/Change the content of the Edit Box from the keyboard.

Can anyone tell me how I can programmatically read the changed text content of the Combobox Edit box.

The FireFly FF_ComboBox_GetText command only reads the content of the Combobox's selected index.?? not the text in the Edit Box.

Any assistance appreciated.    8)

Regards Gian

Gian Young Australia
Title: How to use the Edit Box in a ComboBox
Post by: TechSupport on May 30, 2005, 05:01:35 PM
Hi Gian,

I am pretty sure that a simple FF_Control_GetText will retrieve the text from the edit box:

FF_Control_GetText(HWND_FORM1_COMBO1)
Title: How to use the Edit Box in a ComboBox
Post by: gian young on May 30, 2005, 10:12:18 PM
Thank you for your reply Paul.

You are quite correct, FF_Control_GetText (HWND_FORM1_COMBO1)
works as needed.

I now feel a jerk because I swear I tried this unsuccessfully before posting the question.   :oops:  

Anyway it's welcome to know that help is at hand when required.  :)

Best Regards

Gian
Title: How to use the Edit Box in a ComboBox
Post by: Roger Garstang on May 30, 2005, 10:34:55 PM
The Edit Portion is also a child of the Combo, so you could get even more creative and set it up and send messages to it like an Edit control.  I can't recall the ID offhand, but I gave it to Paul sometime back, and I think it may still be used in generated code...plus WinSpy can give it to you.  It is something simple like 101 or something.
Title: How to use the Edit Box in a ComboBox
Post by: Jean-Pierre LEROY on February 11, 2006, 10:36:44 AM
Hi,

I'm also using a ComboBox control in FireFly with the CBS_DROPDOWN style (Editable ComboBox like a TextBox) for the first time.

It seems we can use both FF_Control_GetText or FF_Textbox_GetText to retrieve the text from the ComboBox in this case.

Paul is there any difference between these two functions ?

Thank you
Jean-Pierre.
Title: How to use the Edit Box in a ComboBox
Post by: TechSupport on February 11, 2006, 03:14:09 PM
If you look at the generated code for those functions you will notice that the ff_control_gettext uses:

        GetWindowText hWndControl, ByVal StrPtr(nBuffer), nBufferSize


The ff_combobox_gettext uses:

        If SendMessage( hWndControl, %CB_GETLBTEXT, nIndex, ByVal StrPtr(nBuffer)) = %CB_ERR Then


Personally, if there is a more specific message for a control then I would use that (i.e. ff_combobox_gettext).
Title: How to use the Edit Box in a ComboBox
Post by: Jean-Pierre LEROY on February 12, 2006, 06:12:14 AM
Hi Paul,

Thank you you for your reply but my question was between FF_Control_GetText and FF_Textbox_GetText; in this cas the generated code seems to be the same.

Jean-Pierre