1
A
回答
3
可以使用TShape
组件的画布属性来绘制数,访问此受保护的财产,你必须创建派生类T形,并发布该属性或只使用一个interposer class。
type
TShape = class(ExtCtrls.TShape); //interposer class
TForm1 = class(TForm)
Shape1: TShape;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Shape1.Canvas.Font.Name :='Arial';// set the font
Shape1.Canvas.Font.Size :=20;//set the size of the font
Shape1.Canvas.Font.Color:=clBlue;//set the color of the text
Shape1.Canvas.TextOut(10,10,'1999');
end;
1
将它上面的的TLabel并使其背景透明(透明=真)。如果编辑文本对齐需要(阵营:= taCenter)
相关问题
- 1. 如何在文件中编写一个字符串和一个numpy数组?
- 2. 如何编写一个SVG字符串以C#编写文件
- 3. 在具有相同数量的数组中编写一个数字,如数字
- 4. 如何附上参考编写组件
- 5. 如何在c中为一个条件编写一个数字范围
- 6. 如何编写一个检查3个数字组合的函数?
- 7. 如何编组一个C#字符串数组到VB6数组?
- 8. 如何编写一个if语句来处理两组数组?
- 9. 如何在C#中编组一个字节数组?
- 10. 如何编写一个nfloat文字?
- 11. 如何编写一个返回一组行的postgres函数?
- 12. 如何在WriteableBitmap上编写字符串?
- 13. 如何写一个字符数组“char * buff []”到一个文件中c
- 14. 如何写一个多维数组到一个文本文件?
- 15. 如何写一个数组到一个文件,而无需HTML
- 16. 如何在pascal中编写数组?
- 17. 如何编写一个jQuery UI插件?
- 18. 如何写一个字符串序列,然后将一个字节数组写入文件?
- 19. Antd:如何重写一个组件
- 20. 如何编写一个字符串替代MATLAB中的一个数字?
- 21. 如何用csv文件编写2个数组使用php
- 22. 为什么写一个小字节数组到一个文件比写一个大数组要快?
- 23. C#如何编写整个数组如果字符串包含关键字
- 24. 在一个数组中写入字符和数字
- 25. 如何编写一个计算器,增加,数字连续(SWIFT)
- 26. 如何在es6中编写子组件(子组件)?
- 27. 如何编辑一个对象数组的单个字段?
- 28. 如何编写下一个和上一个按钮的代码?
- 29. 如何写一个数字作为文本,而在csv文件在python写
- 30. 如何编写单个组件XML以在所有版本的Joomla上安装?
嗨RRUK ...我没有得到TShape的Canvas属性。是那个属性可用..? – rakesh
请仔细阅读答案,画布是一个受保护的属性,在示例代码中检查此行TShape = class(ExtCtrls.TShape);''。 – RRUZ
我完全没有读完抱歉......感谢您的建议。 :) – rakesh