Add Field List to ComboBox

xiaoxiao2021-03-06  112

/ / Add a field to the specified ComboBox.itmes, and ComboBox is displayed as Field.displayLabel, // can get the corresponding fields // not add BLOB, GRAPHIC, OLE, Reference, Bytes, etc. Type field // Do not add Visible = false field // article for authors, please do not reprint! // My blog: Programming Handbook http://blog.9cbs.net/nhconchprocedure ListfieldStoCombox (fidlds: tfields; cbtarget: tcomboBox); var i: integer; begin cbtarget.Items.clear; for i: = 0 To Fields. Count-1 do if (not (Fields [i] .DataType in [ftUnknown, ftBlob, ftGraphic, ftBytes, ftVarBytes, ftParadoxOle, ftDBaseOle, ftCursor, ftADT, ftArray, ftReference, ftDataSet])) and (Fields [i] .Visible ) THEN CBBTARGET.ITEMS.AddObject (Fields [i] .displayLabel, Fields [i]); END;

转载请注明原文地址:https://www.9cbs.com/read-100788.html

New Post(0)