相关疑难解决方法(0)

在Delphi 7中制作TPageControl

我不知道这个问题是否可以在这里得到解答,但我希望它会.我在Delphi 7中编写了一个简单的文本编辑器,它是我在Windows下编写C代码的主要IDE.我在VM中运行Windows,我需要一些简单的东西.在任何情况下,它都使用TpageControl,只要您打开或创建新文件,它就会获得一个新选项卡.很标准.现在,Delphi下的TPageControl没有平面属性.

不,我不是指将标签样式设置为tsButtons或tsFlatButtons

边框不能设置为"none",当您将文本编辑器添加到选项卡控件时,它看起来非常糟糕.

有没有办法让TpageControl保持平坦?

编辑:

在支持平板的开源页面控件上我发现了:

procedure TCustomTabExtControl.WndProc(var Message: TMessage);
begin
  if(Message.Msg=TCM_ADJUSTRECT) and (FFlat) then
   begin
    Inherited WndProc(Message);
    Case TAbPosition of
    tpTop : begin
    PRect(Message.LParam)^.Left:=0;
    PRect(Message.LParam)^.Right:=ClientWidth;
    PRect(Message.LParam)^.Top:=PRect(Message.LParam)^.Top-4;
    PRect(Message.LParam)^.Bottom:=ClientHeight;
  end;
    tpLeft : begin
    PRect(Message.LParam)^.Top:=0;
    PRect(Message.LParam)^.Right:=ClientWidth;
    PRect(Message.LParam)^.Left:=PRect(Message.LParam)^.Left-4;
    PRect(Message.LParam)^.Bottom:=ClientHeight;
  end;
    tpBottom : begin
    PRect(Message.LParam)^.Left:=0;
    PRect(Message.LParam)^.Right:=ClientWidth;
    PRect(Message.LParam)^.Bottom:=PRect(Message.LParam)^.Bottom-4;
    PRect(Message.LParam)^.Top:=0;
  end;
    tpRight : begin
    PRect(Message.LParam)^.Top:=0;
    PRect(Message.LParam)^.Left:=0;
    PRect(Message.LParam)^.Right:=PRect(Message.LParam)^.Right-4;
    PRect(Message.LParam)^.Bottom:=ClientHeight;
    end;
  end;
 end else Inherited WndProc(Message);

end;
Run Code Online (Sandbox Code Playgroud)

问题是,当我在主应用程序上尝试类似的东西时,它将无法工作.它甚至不会编译.

delphi

8
推荐指数
1
解决办法
9022
查看次数

标签 统计

delphi ×1