ReportViewer控件加载指标?控件、加载、指标、ReportViewer

2023-09-03 08:49:00 作者:起航

是否有可能改变ReportViewer控件的图像(绿色纺纱的事情)?

Is it possible to change the image (the green spinning thing) of the ReportViewer control?

目前,我正在隐藏它和重叠的进度条(这是的WinForms不是ASP的控制)......似乎有点长篇大论?

At the moment I am hiding it and overlapping a progress bar (this is WinForms not the ASP Control)... Seems a bit long winded?

由于:)

推荐答案

好了,你给我这一个我的朋友是一个挑战。但我想通了,如何做到这一点。这里是我以前把这事办成code:

Well, you gave me a challenge with this one my friend. But I figured out how to do this. Here is the code that I used to pull this off:

 Private Sub CustomizeRV(ByVal ctrl As Control)
    For Each c As Control In ctrl.Controls

      If TypeOf c Is PictureBox Then
        Dim pb As PictureBox = DirectCast(c, PictureBox)
        pb.Image = YOURNEWIMAGEHERE
      End If

      If c.HasChildren Then
        CustomizeRV(c)
      End If
    Next
  End Sub

你的窗体加载事件中调用该函数,它将重新加载图像,无论你指定(传递函数ReportViewer控件)。该函数的递归调用,直到该图片被发现。只有一个在ReportViewer控件PictureBox的,所以你不必担心找不到那个具体的问题。

Call this function during your form load event, and it will reconfigure the loading image to whatever you specify (pass the function the ReportViewer control). The function is called recursively until the picturebox is found. There is only one picturebox in the ReportViewer control, so you don't have to worry about finding that specific one.