因为需要在每个 tab 的右边显示关闭按钮,所以想到了在 tab 上面放一个 speedbutton 在 RzPageControl 的 DrawTabFace 函数中增加 代码如下:
if FTabCloseButton <> nil then
begin
with FTabCloseButton do
begin
Parent := Self;
Left := FaceRect.Right - 19;
Top := FaceRect.Bottom - 20;
Caption := '#';
Self.Images.GetBitmap(0,Glyph);
Show;
end;
end;
编译通过,但是在使用的时候运行到如下代码报错 try
// Fill the background of the tab (inside the region)
DrawTabBackground( ATabIndex, ARect );
// Draw the tab caption & image
DrawTabFace( ATabIndex, ARect );
finally
// De-activate clipping region
if RestoreDC( FBuffer.Canvas.Handle, -1 ) = WordBool( 0 ) then
raise Exception.Create( sRzRestoringDCError );
end;
请问 RestoreDC 起到什么作用?为什么我添加了第一段代码之后 RestoreDC 会报错?有什么办法解决?谢谢
if FTabCloseButton <> nil then
begin
with FTabCloseButton do
begin
Parent := Self;
Left := FaceRect.Right - 19;
Top := FaceRect.Bottom - 20;
Caption := '#';
Self.Images.GetBitmap(0,Glyph);
Show;
end;
end;
编译通过,但是在使用的时候运行到如下代码报错 try
// Fill the background of the tab (inside the region)
DrawTabBackground( ATabIndex, ARect );
// Draw the tab caption & image
DrawTabFace( ATabIndex, ARect );
finally
// De-activate clipping region
if RestoreDC( FBuffer.Canvas.Handle, -1 ) = WordBool( 0 ) then
raise Exception.Create( sRzRestoringDCError );
end;
请问 RestoreDC 起到什么作用?为什么我添加了第一段代码之后 RestoreDC 会报错?有什么办法解决?谢谢
解决方案 »
- delphi翻页控件
- 如何改变ListView中的子窗口ListColumns的颜色,它一直是灰色的
- Access表mdb数据库另存怎么实现
- 测试连接失败,因为初始化程序提供时发生错误。发生了一个Oracle错误,但无法从Oracle中检索错误信息”
- 来说说动态提取Exe文件所在路径。
- 关于打印的问题!
- 如何在日期字段里用sql输入一个空值?
- 怎么让网页能显示DLL文件
- 如何实现DBGRID里内容的打印?
- 难道csdn每人能解决李维<delphi和分布式多层应用系统第二章dynamicsqldemo的问题吗,50分求教。
- 利用TIdUDPServer、TIdUDPClient上传文件速度慢问题 急!
- 停电,窗体文件损坏,怎么办?
var AllowClose: Boolean);
begin
RzPageControl1.ActivePage.TabVisible := false;
end;