tcombobox

How to store values from an SQL query into a ComboBox component?

眉间皱痕 提交于 2020-01-06 06:36:32
问题 I have a problem with the TComboBox component in Borland C++Builder 6. In the ComboBox, I want to insert the result of an SQL query, eg: ID value --------- 1 one 2 two 3 three I want to display the values of the value column to the user, e.g. one , two , three , but reference the values of the ID column. Can anyone help me? Google did not say a lot about this to me. 回答1: apologize forgot to put in some code ComboBox1->AddItem("one", (TObject *) 1); ComboBox1->AddItem("two", (TObject *) 2);

How to store values from an SQL query into a ComboBox component?

懵懂的女人 提交于 2020-01-06 06:35:21
问题 I have a problem with the TComboBox component in Borland C++Builder 6. In the ComboBox, I want to insert the result of an SQL query, eg: ID value --------- 1 one 2 two 3 three I want to display the values of the value column to the user, e.g. one , two , three , but reference the values of the ID column. Can anyone help me? Google did not say a lot about this to me. 回答1: apologize forgot to put in some code ComboBox1->AddItem("one", (TObject *) 1); ComboBox1->AddItem("two", (TObject *) 2);

Is it possible to add a history list dropdown to Delphi's TButtonedEdit?

倖福魔咒の 提交于 2020-01-01 12:32:31
问题 I'm using Delphi XE2's TButtonedEdit but I would like to add a dropdown list for the history (like TComboBox). I know that TComboBox is a glorified TEdit, so is there a message I can send to TButtonedEdit to add this functionality please? Thanks. 回答1: You can use the IAutoComplete2 interface to accomplish this task. Check this sample code (adapted for TButtonedEdit and Delphi XE2), based on this answer (Auto append/complete from text file to an edit box delphi) from Ken White uses Winapi

Is it possible to add a history list dropdown to Delphi's TButtonedEdit?

瘦欲@ 提交于 2020-01-01 12:32:02
问题 I'm using Delphi XE2's TButtonedEdit but I would like to add a dropdown list for the history (like TComboBox). I know that TComboBox is a glorified TEdit, so is there a message I can send to TButtonedEdit to add this functionality please? Thanks. 回答1: You can use the IAutoComplete2 interface to accomplish this task. Check this sample code (adapted for TButtonedEdit and Delphi XE2), based on this answer (Auto append/complete from text file to an edit box delphi) from Ken White uses Winapi

Is it possible to made a TCombo edit caret 'wider' or to 'bold' it?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 16:06:26
问题 I have an mode that uses TComboBox.SelStart to indicate progress along the edit text string. In this mode I would like to make some kind of change to the edit caret, for example to widen it to 2 pixels or 'bold' it in some way to indicate this mode and to have it grab more attention. Is this possible? 回答1: Yes, as Alex mentioned in his comment, this can be done using API calls. Example: procedure SetComboCaretWidth(ComboBox: TComboBox; Multiplier: Integer); var EditWnd: HWND; EditRect: TRect;

Delphi firemonkey TCombobox extreme slow opening

删除回忆录丶 提交于 2019-12-12 07:04:05
问题 Windows 10, Delphi 10.2 Tokyo, Firemonkey framework. I drop a TCombobox on the form, populate it with 20000 items (takes 5 seconds), then when I click the arrow of the combobox for the dropdown to appear, it takes 15 seconds to do so. The VCL TComboBox does this instantly for me. Is there anything I can do to speed up this behavior? Why does it take that long? 来源: https://stackoverflow.com/questions/43232968/delphi-firemonkey-tcombobox-extreme-slow-opening

Delphi Seattle TCombobox Dropdowncount not working when using ownerdraw style

匆匆过客 提交于 2019-12-11 23:25:58
问题 I have an owner-drawn TComboBox in Delphi Seattle which ignores any settings to the DropDownCount property. The height of the individual items is 59 pixels and the width is 311 pixels. I have 5 entries in the Items stringlist. Setting a value below 8 results in no dropdown being shown at all, while any higher values result in only 1 item being shown in the dropdown along with a vertical scrollbar. I need to be able to show all 5 entries in the items list in the dropdown. Here's the DFM to

can I change the color of python ttk combobox under windows?

寵の児 提交于 2019-12-11 01:39:03
问题 I got working code under Linux to change the appearance of a TCombobox of Ttk under python 2.7. If I run the code under windows, it wont work. Im aware, that colors and also attributes of the ttk widgets are platform-dependant. Still I cannot figure out how to change the color of either the textarea or the downarrow of the combobox under windows. The code, which is working under linux is like that: self = Tkinter.Canvas style = ttk.Style() style.configure('Yellow.TCombobox',background="yellow

How a Combobox with the csOwnerDrawFixed Style can behave like the csDropDown style?

試著忘記壹切 提交于 2019-12-04 21:57:57
问题 I'm using a TComboBox component with the style property set to csOwnerDrawFixed , I implement the OnDrawItem And everything works fine, Now I want which the combobox to behave like when had the csDropDown style (with the csOwnerDrawFixed style behaves like the csDropDownList style) , I mean with a inner editor. is this possible? 回答1: Delphi's TComboBox wrapper doesn't support an owner draw editable style, but the underlying Windows control does, and it's easy to enable it. Create a new

Is it possible to add a history list dropdown to Delphi's TButtonedEdit?

流过昼夜 提交于 2019-12-04 10:10:55
I'm using Delphi XE2's TButtonedEdit but I would like to add a dropdown list for the history (like TComboBox). I know that TComboBox is a glorified TEdit, so is there a message I can send to TButtonedEdit to add this functionality please? Thanks. RRUZ You can use the IAutoComplete2 interface to accomplish this task. Check this sample code (adapted for TButtonedEdit and Delphi XE2), based on this answer ( Auto append/complete from text file to an edit box delphi ) from Ken White uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls,