M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-18 #1 我写了一个控件,继承TToolWin,在上面动态生成一些按钮,就像TOOLBAR那样 我想把设计时按钮写入到DFM,也就是下次打开FORM时它上的按钮还在上面 如何做呢?
B beta Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-18 #2 property AButton: TButton read FButton write SetButton stored True;
Q qdyoung Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-18 #3 是不是有 Buttons 属性,是不是 Stored true,就可以 ----- http://www.8421.org
M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-18 #4 我是这样的: TComponentPalette = class(TToolWindow) private { Private declarations } FButtons: TList; ... public { Public declarations } procedure InsertButton; ... published ... end; procedure TComponentPalette.InsertButton; var Button: TSpeedButton; begin Button := TSpeedButton.Create(Self); Button.Parent := Self; FButtons.Add(Button); UpdateButtonPostion; end; 按钮都动态创建并放在FButtons里边,这个怎么保存呢?
我是这样的: TComponentPalette = class(TToolWindow) private { Private declarations } FButtons: TList; ... public { Public declarations } procedure InsertButton; ... published ... end; procedure TComponentPalette.InsertButton; var Button: TSpeedButton; begin Button := TSpeedButton.Create(Self); Button.Parent := Self; FButtons.Add(Button); UpdateButtonPostion; end; 按钮都动态创建并放在FButtons里边,这个怎么保存呢?
Z zw960122 Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-19 #5 你真搞笑!·都知道ToolBar了还想让我说什么呀。 要不。我给你拷个ToolBar 的源码吧,行不?
M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-19 #6 我看不懂呀,你懂你讲清楚了我给你加分 源码到处都是,你懂吗?
M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-19 #7 我说的是效果像ToolBar那样,这也没看出来,够弱的 哈哈
M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-20 #8 解决了,重裁DefineProperties即可 [][][][][][][][][][][][]
M Milpas Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-20 #10 获得一点经验: 看标准的控件并不好,容易看不懂 看第三方的同类控件就清晰多了