首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

RZSplitter分割控件使用有关问题

2013-07-23 
RZSplitter分割控件使用问题现在遇到一个问题,RZSplitter中左右面板需要运行中互换,左边变为右边,右边变为

RZSplitter分割控件使用问题
现在遇到一个问题,RZSplitter中左右面板需要运行中互换,左边变为右边,右边变为左边,该如何实现?
[解决办法]


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RzPanel, ExtCtrls, RzSplit, RzButton;

type
  TForm1 = class(TForm)
    rzspltr1: TRzSplitter;
    rzpnl1: TRzPanel;
    rzpnl2: TRzPanel;
    btn1: TRzButton;
    btn2: TRzButton;
    procedure rzpnl1Click(Sender: TObject);
    procedure rzpnl2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.rzpnl1Click(Sender: TObject);
begin
  if rzpnl1.Parent=rzspltr1.UpperLeft.Pane then
  begin
    rzpnl2.Parent:=rzspltr1.UpperLeft.Pane;
    rzpnl1.Parent:=rzspltr1.LowerRight.Pane;
  end else
  begin
    rzpnl1.Parent:=rzspltr1.UpperLeft.Pane;
    rzpnl2.Parent:=rzspltr1.LowerRight.Pane;
  end;
end;

procedure TForm1.rzpnl2Click(Sender: TObject);
begin
  if rzpnl1.Parent=rzspltr1.UpperLeft.Pane then
  begin
    rzpnl2.Parent:=rzspltr1.UpperLeft.Pane;
    rzpnl1.Parent:=rzspltr1.LowerRight.Pane;
  end else
  begin
    rzpnl1.Parent:=rzspltr1.UpperLeft.Pane;
    rzpnl2.Parent:=rzspltr1.LowerRight.Pane;
  end;
end;

end.



可以单击panel试试看

热点排行