zoukankan      html  css  js  c++  java
  • Delphi 动态改变Rzsplitter的Orientation(方向)属性

    效果图:

    原先不知道,弄了半天都改不了RzSplitter.Orientation = orHorizontal / orVertical

    然后去查该组件的源代码,原来Orientation不是在RzSplit单元定义的,而是在RzCommon这个单元,uses它后,一切正常了。

    RzCommon Unit
    //...
    type
      TAlignmentVertical = ( avTop, avCenter, avBottom );
    
      TBlinkState = ( bsOn, bsOff );
    
      TTextStyle = ( tsNormal, tsRaised, tsRecessed, tsShadow );
      TOrientation = ( orHorizontal, orVertical );  //此处
      TBarStyle = ( bsTraditional, bsLED, bsGradient );
      TLineStyle = ( lsNone, lsFlat, lsGroove, lsBump );
    
    //Button1 的 OnClick事件
    procedure TForm1.Button1Click(Sender: TObject);
    var
      w, h: Integer;
    begin
      w := Ceil((RzSplitter1.UpperLeft.Pane.Height / RzSplitter1.Height) * RzSplitter1.Width);  //width
      h := Ceil((RzSplitter1.UpperLeft.Pane.Width / RzSplitter1.Width) * RzSplitter1.Height);  //height
      if RzSplitter1.Orientation = orHorizontal then
      begin
        RzSplitter1.Orientation := orVertical;
        RzSplitter1.UpperLeft.Pane.Height := h;
        RzSplitter1.Position := RzSplitter1.UpperLeft.Pane.Height;
        Button1.Caption := 'Vertical (垂直铺设)';
      end
      else
      begin
        RzSplitter1.Orientation := orHorizontal;
        RzSplitter1.UpperLeft.Pane.Width := w;
        RzSplitter1.Position := RzSplitter1.UpperLeft.Pane.Width;
        Button1.Caption := 'Horizontal (水平铺设)';
      end;
    
    end;
    

      

      

  • 相关阅读:
    Java版本及历史简述
    ASCII、Unicode、UTF-8、UTF-16、GBK、GB2312、ANSI等编码方式简析
    同步(Synchronous)和异步(Asynchronous)方法的区别
    例10-12 *uva1637(概率dp)
    例10-11 uva11181
    例10-10 uva10491(简单概率)
    例10-9 uva1636简单概率问题
    全排列hash-康拓展开
    10-8 uva1262密码
    例10-6 uva1635(唯一分解定理)
  • 原文地址:https://www.cnblogs.com/go-jzg/p/4115530.html
Copyright © 2011-2022 走看看