200分求解,Delphi的代码编辑窗底部的状态栏中...(100分)

  • 主题发起人 主题发起人 jc_wwp
  • 开始时间 开始时间
J

jc_wwp

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi的代码编辑窗底部的状态栏中,
切换Code/Diagram的梯形标签是如何实现的,有无现成的控件?

请大侠帮忙!!!
 
PageControl1.tabposition:=tpBottom
这样?我只有d5。猜想的。
 
状态栏自绘事件和TabSet控件的结合.


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Tabs, ComCtrls, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
TabSet1: TTabSet;
StatusBar1: TStatusBar;
Notebook1: TNotebook;
Panel1: TPanel;
Panel2: TPanel;
procedure FormCreate(Sender: TObject);
procedure TabSet1Change(Sender: TObject; NewTab: Integer;
var AllowChange: Boolean);
private
procedure DrawStatusBar1Panel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
StatusBar1.Panels.Clear;
StatusBar1.Panels.Add;
StatusBar1.Panels.Add;
StatusBar1.Panels[1].Style:=psOwnerDraw;
TabSet1.Parent:=StatusBar1;
TabSet1.Tabs.Clear;
TabSet1.Tabs.Add('Tab1');
TabSet1.Tabs.Add('Tab2');
TabSet1.TabIndex:=0;
StatusBar1.OnDrawPanel:=DrawStatusBar1Panel;
end;

procedure TForm1.DrawStatusBar1Panel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin
if Panel.Index=1 then
TabSet1.SetBounds(Rect.Left,Rect.Top,Rect.Right-Rect.Left,Rect.Bottom-Rect.Top);
end;

procedure TForm1.TabSet1Change(Sender: TObject; NewTab: Integer;
var AllowChange: Boolean);
begin
Notebook1.PageIndex:=NewTab;
end;

end.
 
学习:)
 
学习
谢谢各位
 
哈哈哈,原来是老古董....

多谢楼上的两位了!
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部