乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Transparent TCustomcontrol

       quasiceo 2013-05-03
       
        #2  
      Old 11-21-2002, 03:31 AM
      Senior Member
       
      Join Date: Apr 2001
      Posts: 2,182
      Default RE: Transparent TCustomcontrol

      Transparent TCustomcontrol
      hi to all,

      I have a problems with making a TCustomcontrol transparent.
      I added:

      Procedure CreateParams(var Params: TCreateParams); override;

      implenmentation

      procedure TDSPTransparentPanel.CreateParams(var Params: TCreateParams);
      begin
      { call the create of the params }
      inherited CreateParams(Params);
      Params.ExStyle := Params.ExStyle + WS_EX_Transparent;
      ControlStyle := ControlStyle - [csOpaque] + [csAcceptsControls]
      end;


      This makes the Component transparent, but when I place an
      Imagebox on it and I'am moveing the Imagebox per runtime,
      the background of the TCustomcontrol losess it's
      tranzparency . When I minimize and maximize the Form or when I move an other Window over it (e.g. explorer) , the transparency will be back.

      So here is my Question:
      What must I do to get this effect by code, to get the transparency back?
      I called self.redraw , self.invalidate but without effect.


      Please help me solve this Problem
      Best Regards
      BT
      Try this:


      Override its CreateParam method like this:

      private // in control declaration
      Procedure CreateParams( Var params: TCreateParams ); override;

      Procedure TTransparentXXX.CreateParams( Var params: TCreateParams );
      begin
      inherited CreateParams( params );
      params.ExStyle := params.ExStyle or WS_EX_TRANSPARENT;
      end;

      Add a handler for the WM_ERASEBKGND message:

      Procedure WMEraseBkGnd( Var msg: TWMEraseBkGnd );
      message WM_ERASEBKGND;

      Procedure TTransparentXXX.WMEraseBkGnd( Var msg: TWMEraseBkGnd );
      begin
      SetBkMode( msg.DC, TRANSPARENT );
      msg.result := 1;
      end;

      That is the basic frame for a TWinControl descendent. For a
      TGraphicsControl you would drop the CreateParams (since only
      WinControls have that method) and override the create constructor.
      After calling the inherited constructor you modify the ControlStyle of
      the control:

      ControlStyle := ControlStyle - [csOpaque];

      Transparency actually works better for TGraphicControls than for
      TWinControls. The latter have problems if the control is moved or the
      background needs to change. Delphi container controls (like form or
      panel) are always created with the WS_CLIPCHILDREN style, which
      automatically excludes the area under child controls from updates, so
      the background will not be updated if required. Removing the
      WS_CLIPCHILDREN style from a controls parent is possible with

      SetWindowLong( parent.handle, GWL_STYLE,
      GetWIndowLong( parent.handle, GWL_STYLE )
      and not WS_CLIPCHILDREN );



      Greetz,
      ::TeD On The NeT::

      =[ QUESTIONS ]=========================================
      please click Accept as Answer if my reply helped you.

      =[ EXTRA INFO ]========================================
      Location : Netherlands (GMT +01.00)
      Languages : English, Dutch, German
      Age : 25
      ICQ : Be smart and figure out what my UIN is...
      -------------------------------------------------------
      Used OS : Win2k SR2 | Win2k SR3
      Delphi # : Enterprise 5 SP2 | Enterprise 6 SP2
      ================================================== =====
      Reply With Quote
        #3  
      Old 11-21-2002, 06:07 AM
      Member
       
      Join Date: Nov 2001
      Posts: 55
      Default Transparent TCustomcontrol

      I added a TImage to the create proedure in my
      Transparent Component (TCustumcontrol) Create procedure:


      Ibar := TImage.create(self);
      Ibar.parent := self;
      SetWindowLong(Ibar.parent.handle, GWL_STYLE,
      GetWIndowLong(Ibar.parent.handle, GWL_STYLE )
      and not WS_CLIPCHILDREN );


      but when I move the Ibar per runtime the background of my Component will not updated. What can be wrong?


      Please Help
      Best Regards
      BT
      Reply With Quote
      Ibar.parent := self.parent可以解決!;

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類(lèi)似文章 更多