又发现了delphi的一个bug!在panel容器里放一个小的背景图片,form平铺,groupbox平铺,panel不平铺,但是panel也有brush的属性,请大家一起测试一下.反正,我没弄出来,是不是BUG还有待高高手测试一下

解决方案 »

  1.   

    就是这个问题,我帮walkkma贴在这里
    许多网页都有背景图案,这样可以使页面看起来更加醒目。在Delphi 里你也可以设计这种类型的窗体。
     在Form中添加Image控件,设BMP图象,name为image1,在Form的OnCreate事件中写入 form1.Brush.Bitmap:=image1.picture.bitmap;form可以
    panel1.Brush.Bitmap:=image1.picture.Bitmap;panel1不可以
    为什么?
      

  2.   

    不要看到什么就说Bug
    In most descendants of TWinControl, the job of drawing the control's surface belongs to the underlying Windows screen object. If a control has visible features that cannot be rendered by a Windows screen object, it requires access to a canvas object so it can do its own drawing.TCustomControl is one of two base classes for controls that draw their own surfaces. Because TCustomControl is descended from TWinControl, instances of its descendants can receive the focus and serve as containers.Classes of controls that perform their own screen rendering and do not need the features of TWinControl should be descendants of TGraphicControl instead of TCustomControl. TGraphicControl objects can render themselves with less overhead, because they do not have underlying Windows screen objects.TCustomControl objects have a Paint method, which is called whenever the control needs to render its image. Custom controls paint themselves using the Canvas property.