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





In This Topic
DocumentAlignment Property (GdViewer)
In This Topic
Gets or sets the default page alignment within the GdViewer control when the area of the control is smaller than the document to be displayed in its current zoom configuration. For example, setting this property to ViewerDocumentAlignment.DocumentAlignmentTopLeft displays the most top-left part of the current page during the zoom-in operation.
Syntax
'Declaration
 
Public Property DocumentAlignment As ViewerDocumentAlignment
public ViewerDocumentAlignment DocumentAlignment {get; set;}
public read-write property DocumentAlignment: ViewerDocumentAlignment; 
public function get,set DocumentAlignment : ViewerDocumentAlignment
public: __property ViewerDocumentAlignment get_DocumentAlignment();
public: __property void set_DocumentAlignment( 
   ViewerDocumentAlignment value
);
public:
property ViewerDocumentAlignment DocumentAlignment {
   ViewerDocumentAlignment get();
   void set (    ViewerDocumentAlignment value);
}

Property Value

The default value is ViewerDocumentAlignment.DocumentAlignmentMiddleCenter.
Example
How to set the required document alignment.
'We assume that the GdViewer1 control has been properly integrated.
            
'Determine the current document alignment.
MessageBox.Show("The current document alignment is " + GdViewer1.DocumentAlignment.ToString() + ".", "GdViewer.DocumentAlignment")
'Set the required document alignment.
GdViewer1.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopLeft
//We assume that the GdViewer1 control has been properly integrated.
            
//Determine the current document alignment.
MessageBox.Show("The current document alignment is " + GdViewer1.DocumentAlignment.ToString()+ ".", "GdViewer.DocumentAlignment");
//Set the required document alignment.
GdViewer1.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopLeft;
See Also