zoukankan      html  css  js  c++  java
  • 实现无标题栏但有边框的窗口

    本例效果图:



    代码文件:
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm1 = class(TForm)
        CheckBox1: TCheckBox;
        procedure CheckBox1Click(Sender: TObject);
      private
        procedure MyMsg(var Msg: TWMNCHitTest); message WM_NCHITTEST;
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.CheckBox1Click(Sender: TObject);
    begin
      SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) xor WS_CAPTION);
      if not CheckBox1.Checked then begin Hide; Show; end;
    end;
    
    procedure TForm1.MyMsg(var Msg: TWMNCHitTest);
    begin
      Inherited;
      if Msg.Result = HTCLIENT then Msg.Result := HTCAPTION;
    end;
    
    end.
    
    窗体文件:
    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 107
      ClientWidth = 228
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object CheckBox1: TCheckBox
        Left = 32
        Top = 40
        Width = 161
        Height = 17
        Caption = #26080#26631#39064#26639#20294#26377#36793#26694#30340#31383#21475
        TabOrder = 0
        OnClick = CheckBox1Click
      end
    end
    
  • 相关阅读:
    session 、cookie、token的区别
    翻译-In-Stream Big Data Processing 流式大数据处理
    一致性hash算法
    HA 部署wordpress
    HA 高可用mysql集群
    JVM内存监视手段和内存溢出解决方案
    vmware linux NAT CON
    spring SOA architecture
    思路
    cookie和session得区别
  • 原文地址:https://www.cnblogs.com/del/p/1279478.html
Copyright © 2011-2022 走看看