{"id":82,"date":"2007-05-12T13:44:47","date_gmt":"2007-05-12T11:44:47","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/combobox-fires-keypressed-twice-fix\/"},"modified":"2007-05-12T13:44:49","modified_gmt":"2007-05-12T11:44:49","slug":"combobox-fires-keypressed-twice-fix","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/combobox-fires-keypressed-twice-fix\/","title":{"rendered":"ComboBox fires &#8220;KeyPressed&#8221; twice &#8211; fix"},"content":{"rendered":"<p><em>1.  TComboBox.OnKeyPress is fired TWICE if style is not csDropDown or csSimple.<br \/>\n      Just drop a Combo and a Label. In the Combo OnKeyPress :<br \/>\n                      label1.Caption:=label1.Caption+Key;<br \/>\n      You will see that if you set the style to csDropDownList, the keys you type into the combo are then doubled. ( exists in D4 and D5 NOT in D1)<br \/>\n<\/em><\/p>\n<p>Workaround : add at the end of your OnKeyPress<br \/>\n[code lang=&#8221;delphi&#8221;]<br \/>\nif (sender as TComboBox).style not in [csDropDown,csSimple] then<br \/>\n  Key:=#0;[\/code]<\/p>\n<p>[tags]Delphi, Components[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. TComboBox.OnKeyPress is fired TWICE if style is not csDropDown or csSimple. Just drop a Combo and a Label. In the Combo OnKeyPress&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1k","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/82"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}