29. juli 2002 - 13:01Der er
7 kommentarer og 1 løsning
ComboBox med ikke redigerbar tekst
Coders, er gået kold i dette simple problem. Teksten i min ComboBox er fremhævet og der kan redigeres i teksten. Teksten til mine itmens skal ikke være redigerbar og dermed ikke fremhævet. Property ?
Set Style to specify how the list and edit region of the combo box should appear.
These are the values in the TComboBoxStyle type:
Value Meaning
csDropDown Creates a drop-down list with an edit box for manually entered text. All items are strings of the same height. csSimple Creates an edit box with a fixed list (list box) underneath. The length of the list is determined by the Height of the combo box. csDropDownList Creates a drop-down list with no edit box; the user cannot enter text manually. All items are strings of the same height. csOwnerDrawFixed Creates an owner-draw drop-down list with no edit box. Each item in the list is the height specified by the ItemHeight property.
csOwnerDrawVariable Creates an owner-draw drop-down list with no edit box. List items can have varying heights.
When Style is csOwnerDrawFixed or csOwnerDrawVariable, the OnDrawItem event occurs when the list items need to be drawn. If Style is csOwnerDrawVariable, an OnMeasureItem event occurs as well.
>>Borrisholt, jep. csDropDownList gør indholdet ikke redigerbart, ok. Men teksten, når den er klappet sammen, er stadig fremhævet med blåt. Den bare skal være med 'normal' hvid baggrund.
Med csDropDownList er combo teksten stadig aktiv selvom der er brugt andre kontroller. Dvs Comboboxen stadig reagerer på pil op selv om den ikke skal have kontrol mere. Da jeg skal bruger piletasterne til noget andet kan ComboBoxen ikke stå og være aktiv hele tiden.
>>Martin, jo. i OnClick event: FormMain.ActiveControl := EnAndenKontrol;
Takker
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.