GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / LockViewer Property
Example





In This Topic
LockViewer Property (GdViewer)
In This Topic
Enables or disables refreshing the GdViewer control.

Turning this property to true avoids refreshing the control. Otherwise, the control will refresh if needed.

Syntax
'Declaration
 
Public Property LockViewer As Boolean
public bool LockViewer {get; set;}
public read-write property LockViewer: Boolean; 
public function get,set LockViewer : boolean
public: __property bool get_LockViewer();
public: __property void set_LockViewer( 
   bool value
);
public:
property bool LockViewer {
   bool get();
   void set (    bool value);
}

Property Value

The default value is false.
Example
How to prevent the control from refreshing during handling an action.
'We assume that the GdViewer1 control has been properly integrated
'and the PdfLaunchAction event has been properly added.
            
'Define the event.
Sub GdViewer1_PdfLaunchAction(ByVal ActionType As PdfActionLaunchOperation, ByRef FilePath As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfLaunchAction
    'Turning this parameter to True disables automatic handling of the file by the toolkit.
    Cancel = True
    'Now you can handle the action.
    GdViewer.LockViewer = True
    System.Diagnostics.Process.Start(FilePath)
End Sub
//We assume that the GdViewer1 control has been properly integrated.
//and the PdfLaunchAction event has been properly added.
            
//Define the event.
void GdViewer1_PdfLaunchAction(PdfActionLaunchOperation ActionType, ref string FilePath, ref bool Cancel)
{
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    Cancel = true;
    //Now you can handle the action.
    GdViewer.LockViewer = true;
    System.Diagnostics.Process.Start(FilePath);
}
See Also