Leadtools.Web Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ScrollBarVisible Property
See Also  Example
Leadtools.Web.Controls Namespace > WebImageViewer Class : ScrollBarVisible Property




Enables or disables automatically showing the scroll bars if the image width or height exceeds the control client area.

Syntax

Visual Basic (Declaration) 
Public Property ScrollBarVisible As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebImageViewer
Dim value As Boolean
 
instance.ScrollBarVisible = value
 
value = instance.ScrollBarVisible
C# 
public bool ScrollBarVisible {get; set;}
C++/CLI 
public:
property bool ScrollBarVisible {
   bool get();
   void set (bool value);
}
JavaScript 
getScrollBarVisible(): boolean;

Return Value

true, automatically show the scroll bars; false, hide the scroll bars.

Example

This example disables the scrollbars, centers the image and uses the panning features in the left mouse button to scroll the image.

Visual BasicCopy Code
Public Sub WebImageViewer_ScrollBarVisible(ByVal mainWebImageViewer As WebImageViewer)
   AddHandler mainWebImageViewer.ImageChanged, AddressOf mainWebImageViewer_ImageChanged
   mainWebImageViewer.MouseInteractiveMode.LeftButton = ImageViewerMouseInteractiveMode.Pan

   '' disable the scrollbars
   mainWebImageViewer.ScrollBarVisible = False
   '' open "image1.tif"
   mainWebImageViewer.OpenImageUrl("Resources\MultiPage.tif")
   '' display the image with dpi
   mainWebImageViewer.UseDpi = False
   '' scroll the image to the center point.
   mainWebImageViewer.ScrollPosition = New Point(CType(mainWebImageViewer.MaxScrollPosition.X / 2, Integer), CType(mainWebImageViewer.MaxScrollPosition.Y / 2, Integer))

   RemoveHandler mainWebImageViewer.ImageChanged, AddressOf mainWebImageViewer_ImageChanged
End Sub

Sub mainWebImageViewer_ImageChanged(ByVal sender As Object, ByVal e As EventArgs)
   '' "New Image is loaded"...
End Sub
C#Copy Code
public void WebImageViewer_ScrollBarVisible(WebImageViewer mainWebImageViewer) 

   mainWebImageViewer.ImageChanged += new EventHandler(mainWebImageViewer_ImageChanged); 
   mainWebImageViewer.MouseInteractiveMode.LeftButton = ImageViewerMouseInteractiveMode.Pan; 
   // disable the scrollbars 
   mainWebImageViewer.ScrollBarVisible = false; 
   // open "image1.tif" 
   mainWebImageViewer.OpenImageUrl(@"Resources\MultiPage.tif"); 
   // display the image with dpi 
   mainWebImageViewer.UseDpi = false; 
   // scroll the image to the center point. 
   mainWebImageViewer.ScrollPosition = new Point(mainWebImageViewer.MaxScrollPosition.X / 2, mainWebImageViewer.MaxScrollPosition.Y / 2); 
 
   mainWebImageViewer.ImageChanged -= new EventHandler(mainWebImageViewer_ImageChanged); 

 
void mainWebImageViewer_ImageChanged(object sender, EventArgs e) 

   // "New Image is loaded"... 
}

Remarks

Default value is true.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also