Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Delphi 中制作了一个按钮组件,并在我的按钮 mouseup 事件中编写了一个错误代码 (strtoint('a');)。当我单击按钮时,会出现一条错误消息并且按钮状态保持按下状态。TSpeedButton 也有同样的问题,但是 TButton 没有这个问题(我认为是因为它是标准的 windows 控件)。是否有任何代码可以添加到我的按钮组件中以消除此错误?
我发现了问题,我应该在 WM_KILLFOCUS 消息过程中添加代码以将按钮恢复到正常状态。