Not to allow editing on a dbcomboBox control

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36041
    Delphimpd
    Participant

    Hi and thanks in advanced.

    How can I can prevent the User to edit or enter data on a dbComboBox. In another words, I want to allow the user ONLY to pick the values in the droList, and not to allow the users to type anything they want. Can this be possible?

    Thanks

    #51579
    CheshireCat
    Participant

    Hello,

    you can try:

    Code:
    procedure TForm1.sDBComboBox1KeyPress(Sender: TObject; var Key: Char);
    begin
    Key := #0;
    end;

    Or you can set the Style to csDropDownList.

    By csDropDownList the Combo Box is empty if data pointer is moved!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.