如何设置Label的焦点控件为SpeedButton?(100分)

  • 主题发起人 主题发起人 lxv
  • 开始时间 开始时间
L

lxv

Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下:
[red]FCaptionLabel.FocusControl:=Self;[/red] <-- 出了问题:Self不是TWinControl的子类。
其中Self为TSpeedButton的子类TFlatTextButton。
怎么办?我的控件是TLabel和TSpeedButton的结合体。以TSpeedButton为主体,如果不设置这个,那么,改变speedbutton的位置等等的时候label不会跟着变。
 
没办法,换别的
 
TSpeedButton是TGraphicControl类,跟TImage控件是一类的,不能设置焦点
 
labeledtext(好像是这个名字)控件使用了上面 的那一句,在编辑的时候就可以让label跟着转,而且还可以自动free。
但是如果(就像我)不加上那一句,程序退出后就会出现access v....错误。我认为是label没有卸载的缘故。该如何卸载呢???
 
TSpeedButton不可能得到焦点,换成没有Caption的TBitBtn吧.
 
如果用TSpeedButton,如何在卸载speedbutton的同时卸载tlabel???
 
无奈的结束
 
多人接受答案了。
 
后退
顶部