<del id="7msxa"><table id="7msxa"><strong id="7msxa"></strong></table></del><legend id="7msxa"></legend>

<tbody id="7msxa"></tbody>
  • <ol id="7msxa"></ol><th id="7msxa"><track id="7msxa"><rt id="7msxa"></rt></track></th>
    1. <dd id="7msxa"></dd>
    2. 首頁 > 編程 > Java > 正文

      制作透明窗體

      2019-09-06 23:33:16
      字體:
      來源:轉載
      供稿:網友

                          1.重載CreateParams函數,設置透明風格
      2.然后重載它的WM_ERASEBKGND消息。
      代碼片段:

      .h File
      class TYourForm:public TForm
      {
      private:
      /tvoid __fastcall WMNC(TMessage &Message);
      public:
      /t__fastcall TYourForm(TComponent *Owner);
      /tBEGIN_MESSAGE_MAP
      /t  VCL_MESSAGE_HANDLER(WM_ERASEBKGND,TMessage,WMNC);
      /tEND_MESSAGE_MAP(TForm);
      protected:
      /tvirtual void __fastcall CreateParams(TCreateParams &Params);
      }


      .cpp File

      void __fastcall TYourForm::CreateParams(TCreateParams &Params)
      {
       TForm::CreateParams(Params);
       Params.EX_STYLE|=WS_EX_TRANSPARENT;
      }
      void __fastcall TYourForm::WMNC(TMessage &Message)
      {
       SetBkMode(GetWindowDC(this->Handle),OPAQUE);
       ReleaseDC(this->Handle,GetWindowDC(this->Handle)) ;
       Messgae.Result=1;
      }
      發表評論 共有條評論
      用戶名: 密碼:
      驗證碼: 匿名發表
      japan日本人妻熟老太
      <del id="7msxa"><table id="7msxa"><strong id="7msxa"></strong></table></del><legend id="7msxa"></legend>

      <tbody id="7msxa"></tbody>
    3. <ol id="7msxa"></ol><th id="7msxa"><track id="7msxa"><rt id="7msxa"></rt></track></th>
      1. <dd id="7msxa"></dd>