各位大虾:在delphi7中是否能设置Form的两个属性使得Form透明??
谢了!!!!!

解决方案 »

  1.   

    No body know this??????????????????????????????????????????????????Help me please!!!!!!!!!!!!!!!!1
      

  2.   

    Delphi中可以这样做: 
        procedure TForm1.FormCreate(Sender: TObject); 
        begin 
         Brush.Style := bsClear; 
         BorderStyle := bsNone 
        end; 
         
      

  3.   

    好像有一种方法 在Form中有一个属性要设定为True???
    各位知道吗????
      

  4.   

    TransParentColor
    TransParentColorValue
      

  5.   

    form的borderStyle设为bsNone;
    在窗体启动创建事件中写 self.Brush.Style :=bsClear;D5中通过,D7没试过,应该没问题
      

  6.   

    alphablend属性alphablendvalue设置范围0~255之间不过注意这样设置以后窗体上的控件也跟着透明
      

  7.   


    .....
      public
        procedure CreateParams(var Params: TCreateParams); override;
        { Public declarations }
    ......procedure TForm1.CreateParams(var Params: TCreateParams);
    begin
      inherited CreateParams(Params);
      Params.ExStyle := Params.ExStyle or WS_EX_TRANSPARENT;
    end;
      

  8.   

    你可以用alphablend函数用代码写
      

  9.   

    你可以设置窗体的TransparentColor属性为True,同时将TransparentColorValue设置成你目前窗体的颜色,它的功能就是将当前为TransparentColorValue的颜色透明。但这个属性只在Win2000或者以上版本好使,在win98下不好使:(
      

  10.   

    可以,但只在WIN2000以上有效.WIN98下无效.
      

  11.   

    我知道有三种方法,第一种:
      Color :=clWhite;
      TransparentColor :=True;
      TransparentColorValue :=clWhite;
    第二种:
        procedure CreateParams(var Params: TCreateParams); override;   procedure TForm1.CreateParams(var Params: TCreateParams);
       begin
         inherited CreateParams(Params);
         Params.ExStyle := Params.ExStyle or WS_EX_TRANSPARENT;
       end;
    第三种:
       AlphaBlendValue :=0;
       AlphaBlend :=True;
      

  12.   

    代码是vc写的也许你有用BOOL CALLBACK EnumChildFunc(HWND hwnd, LPARAM lParam)
    {
        CRgn *pRgn = (CRgn*)lParam;
        CRect rcChild;
        ::GetWindowRect(hwnd, rcChild);
        CRgn rgnChild;
        CRgn rgnCopy;
        rgnCopy.CreateRectRgn(0, 0, 1, 1);
        rgnCopy.CopyRgn(pRgn);
        rgnChild.CreateRectRgn(rcChild.left, rcChild.top, 
                               rcChild.right, rcChild.bottom);
        pRgn->CombineRgn(&rgnCopy, &rgnChild, RGN_OR);
        return TRUE;
    }int SetBackTransparent(CWnd *pWnd, BOOL bClientOnly = TRUE)
    {
        CRgn rgn;
        if(bClientOnly)
        {
            CRgn rgnWindow, rgnClient;
            CRect rcWindow, rcClient, rcRgn;
            pWnd->GetWindowRect(rcWindow);
            pWnd->GetClientRect(rcClient);
            pWnd->ClientToScreen(rcClient);
            rgnWindow.CreateRectRgn(rcWindow.left, rcWindow.top, 
                                    rcWindow.right, rcWindow.bottom);
            rgnClient.CreateRectRgn(rcClient.left, rcClient.top, 
                                    rcClient.right, rcClient.bottom);
            rgn.CreateRectRgn(0, 0, 1, 1);
            rgn.CombineRgn(&rgnWindow, &rgnClient, RGN_DIFF);
        }
        else
        {
            rgn.CreateRectRgn(0, 0, 0, 0);
        }
        ::EnumChildWindows(pWnd->GetSafeHwnd(), (WNDENUMPROC)EnumChildFunc,(LPARAM)&rgn);
        return pWnd->SetWindowRgn(rgn, TRUE);
    }
    调用办法:
    在CYourDialog::OnInitDialog里加上
    SetBackTransparent(this);
    如果要连非客户区都透明,用
    SetBackTransparent(this, FALSE);