Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
BorderStyleChanged Event
See Also  Example
Leadtools.WinForms Namespace > RasterImageViewer Class : BorderStyleChanged Event




Occurs when the value of the BorderStyle property changes.

Syntax

Visual Basic (Declaration) 
Public Event BorderStyleChanged() As EventHandler
Visual Basic (Usage)Copy Code
Dim instance As RasterImageViewer
Dim handler As EventHandler
 
AddHandler instance.BorderStyleChanged, handler
C# 
public event EventHandler BorderStyleChanged()
Managed Extensions for C++ 
public: __event EventHandler* BorderStyleChanged();
C++/CLI 
public:
event EventHandler^ BorderStyleChanged();

Example

This example uses the BorderStyleChanged event to show how the border style has changed.

Visual BasicCopy Code
Private Sub viewer_BorderStyleChanged(ByVal sender As Object, ByVal e As EventArgs)
   Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
   MessageBox.Show(viewer.BorderStyle.ToString())
End Sub
Public Sub RasterImageViewer_BorderStyleChanged(ByVal viewer As RasterImageViewer)
   AddHandler viewer.BorderStyleChanged, AddressOf viewer_BorderStyleChanged

   If viewer.BorderStyle = BorderStyle.Fixed3D Then
      viewer.BorderStyle = BorderStyle.FixedSingle
   Else
      viewer.BorderStyle = BorderStyle.Fixed3D
   End If

   RemoveHandler viewer.BorderStyleChanged, AddressOf viewer_BorderStyleChanged
End Sub
C#Copy Code
private void viewer_BorderStyleChanged(object sender, EventArgs e) 

   RasterImageViewer viewer = sender as RasterImageViewer; 
   MessageBox.Show(viewer.BorderStyle.ToString()); 

public void RasterImageViewer_BorderStyleChanged(RasterImageViewer viewer) 

   viewer.BorderStyleChanged += new EventHandler(viewer_BorderStyleChanged); 
 
   if(viewer.BorderStyle == BorderStyle.Fixed3D) 
      viewer.BorderStyle = BorderStyle.FixedSingle; 
   else 
      viewer.BorderStyle = BorderStyle.Fixed3D; 
 
   viewer.BorderStyleChanged -= new EventHandler(viewer_BorderStyleChanged); 
}

Remarks

This event is raised if the BorderStyle property is changed by either a programmatic modification or user interaction.

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