You can band a ADODB.Recordset to the MSFlexGrid Control and set the filter property.But you must write printing and previewing' code yourself.

解决方案 »

  1.   

    可以使用msflexgrid的paintpicture方法
      

  2.   

    msflexgrid 有paintpicture方法吗?
      

  3.   

    不好意思,错了!应该是:
    Form.PaintPicture msfgrid.Picture
      

  4.   

    或者: 
         Printer.PaintPicture msfgrid.Picture
      

  5.   

    这样可以打印选中的区域吗?怎么我的机器老死机!
    具体怎么用?Thanks
      

  6.   


    打印选中区域不行。但可以打出整个grid的表头带内容。
    一种方法是:你在窗体中放一个隐藏的grid(假设叫 mshHTemp),什么都不用设。
    当要打印时,你把要打印的grid的属性都赋给隐藏的grid,再把要打印的内容(cells)赋给隐藏的,然后
    定义一个printer,然后:
    printer.paintpicture mshHTemp.picture
    即可打印。如果想打印预览,可以用:
    form.paintpicture mshHTemp.picture
    此时会打印到窗体上。