Back to Devexpress

TdxCustomDashboardControl.OnViewerFormShow Event

vcl-dxdashboard-dot-control-dot-tdxcustomdashboardcontrol-1e821fee.md

latest3.6 KB
Original Source

TdxCustomDashboardControl.OnViewerFormShow Event

Allows you to customize Dashboard Viewer dialog form settings.

Declaration

delphi
property OnViewerFormShow: TdxBackendFormNotifyEvent read; write;

Remarks

Handle OnDesignerFormShow and OnViewerFormShow events to customize Dashboard Designer and Dashboard Viewer dialogs when displayed. You can change caption, dimensions, position, and other settings as demonstrated in the following code example: Modify Dashboard Viewer Form Settings.

Event Occurrence

The ShowViewer procedure raises the OnViewerFormShow event.

Event Parameters

The following parameters are available within an OnViewerFormShow event handler:

ASenderProvides access to the TdxDashboardControl component that raised the OnViewerFormShow event.AFormProvides access to the Dashboard Viewer dialog form.

Refer to the TdxBackendFormNotifyEvent procedural type description for detailed information on parameters accessible within an OnViewerFormShow event handler.

Code Example: Modify Dashboard Viewer Form Settings

The following code example demonstrates an OnViewerFormShow event handler that modifies caption, dimensions, and position of the Dashboard Viewer dialog when it is displayed:

delphi
uses
  dxDashboard.Control; // Declares the TdxDashboardControl component
//...

procedure TMyForm.dxDashboardControl1ViewerFormShow(ASender: TObject; AForm: TForm);
begin
  AForm.Caption := 'My Dashboard Viewer'; // Changes the Dashboard Viewer form caption
  AForm.WindowState := wsNormal; // Switches from maximized to the normal form state
  AForm.Position := poScreenCenter; // Centers the dialog on the screen
  AForm.Width := 1200; // Specifies the dialog width
  AForm.Height := 800; // Specifies the dialog height
end;
cpp
#include "dxDashboard.Control.hpp" // Declares the TdxDashboardControl component

// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxDashboard.Control" // Required to use dxDashboard.Control.hpp declarations
// ...

void __fastcall TMyForm::dxDashboardControl1ViewerFormShow(TObject *ASender, TForm *AForm)
{
  AForm->Caption = "My Dashboard Viewer"; // Changes the Dashboard Viewer form caption
  AForm->WindowState = wsNormal; // Switches from maximized to the normal form state
  AForm->Position = poScreenCenter; // Centers the dialog on the screen
  AForm->Width = 1200; // Specifies the dialog width
  AForm->Height = 800; // Specifies the dialog height
}

See Also

TdxReport.OnViewerFormShow Event

TdxCustomDashboardControl Class

TdxCustomDashboardControl Members

dxDashboard.Control Unit