Raises the SizeModeChanged event.
protected virtual void OnSizeModeChanged(
RoutedPropertyChangedEventArgs<SizeMode> e
)
Protected Overridable Sub OnSizeModeChanged( _
ByVal e As RoutedPropertyChangedEventArgs(Of SizeMode) _
)
protected:
virtual void OnSizeModeChanged(
RoutedPropertyChangedEventArgs<SizeMode>^ e
)
e
A RoutedPropertyChangedEventArgs that contains the event data.
Raising an event invokes the event handler through a delegate.
The OnSizeModeChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnSizeModeChanged in a derived class, be sure to call the base class's OnSizeModeChanged method so that registered delegates receive the event.
Imports Leadtools.Windows.Controls
Private Sub viewer_SizeModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As ImageBox = TryCast(sender, ImageBox)
Dim s As String = String.Format("SizeModeChanged Event: {0}", viewer.SizeMode.ToString())
MessageBox.Show(s)
End Sub
Public Sub ImageBox_SizeModeChanged(ByVal viewer As ImageBox)
AddHandler viewer.SizeModeChanged, AddressOf viewer_SizeModeChanged
Select Case viewer.SizeMode
Case SizeMode.Fit
viewer.SizeMode = SizeMode.FitAlways
Case SizeMode.FitAlways
viewer.SizeMode = SizeMode.FitWidth
Case SizeMode.FitWidth
viewer.SizeMode = SizeMode.Normal
Case SizeMode.Normal
viewer.SizeMode = SizeMode.Stretch
Case SizeMode.Stretch
viewer.SizeMode = SizeMode.Fit
End Select
RemoveHandler viewer.SizeModeChanged, AddressOf viewer_SizeModeChanged
End Sub
using Leadtools.Help;
using Leadtools.Windows.Controls;
private void viewer_SizeModeChanged(object sender, EventArgs e)
{
ImageBox viewer = sender as ImageBox;
string s = string.Format("SizeModeChanged Event: {0}", viewer.SizeMode.ToString());
MessageBox.Show(s);
}
public void ImageBox_SizeModeChanged(ImageBox viewer)
{
viewer.SizeModeChanged += new RoutedPropertyChangedEventHandler<SizeMode>(viewer_SizeModeChanged);
switch(viewer.SizeMode)
{
case SizeMode.Fit:
viewer.SizeMode = SizeMode.FitAlways;
break;
case SizeMode.FitAlways:
viewer.SizeMode = SizeMode.FitWidth;
break;
case SizeMode.FitWidth:
viewer.SizeMode = SizeMode.Normal;
break;
case SizeMode.Normal:
viewer.SizeMode = SizeMode.Stretch;
break;
case SizeMode.Stretch:
viewer.SizeMode = SizeMode.Fit;
break;
}
viewer.SizeModeChanged -= new RoutedPropertyChangedEventHandler<SizeMode>(viewer_SizeModeChanged);
}
using Leadtools.Help;
using Leadtools.Windows.Controls;
private void viewer_SizeModeChanged(object sender, EventArgs e)
{
ImageBox viewer = sender as ImageBox;
string s = string.Format("SizeModeChanged Event: {0}", viewer.SizeMode.ToString());
MessageBox.Show(s);
}
public void ImageBox_SizeModeChanged(ImageBox viewer)
{
viewer.SizeModeChanged += new RoutedPropertyChangedEventHandler<SizeMode>(viewer_SizeModeChanged);
switch(viewer.SizeMode)
{
case SizeMode.Fit:
viewer.SizeMode = SizeMode.FitAlways;
break;
case SizeMode.FitAlways:
viewer.SizeMode = SizeMode.FitWidth;
break;
case SizeMode.FitWidth:
viewer.SizeMode = SizeMode.Normal;
break;
case SizeMode.Normal:
viewer.SizeMode = SizeMode.Stretch;
break;
case SizeMode.Stretch:
viewer.SizeMode = SizeMode.Fit;
break;
}
viewer.SizeModeChanged -= new RoutedPropertyChangedEventHandler<SizeMode>(viewer_SizeModeChanged);
}
Imports Leadtools.Windows.Controls
Private Sub viewer_SizeModeChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As ImageBox = TryCast(sender, ImageBox)
Dim s As String = String.Format("SizeModeChanged Event: {0}", viewer.SizeMode.ToString())
MessageBox.Show(s)
End Sub
Public Sub ImageBox_SizeModeChanged(ByVal viewer As ImageBox)
AddHandler viewer.SizeModeChanged, AddressOf viewer_SizeModeChanged
Select Case viewer.SizeMode
Case SizeMode.Fit
viewer.SizeMode = SizeMode.FitAlways
Case SizeMode.FitAlways
viewer.SizeMode = SizeMode.FitWidth
Case SizeMode.FitWidth
viewer.SizeMode = SizeMode.Normal
Case SizeMode.Normal
viewer.SizeMode = SizeMode.Stretch
Case SizeMode.Stretch
viewer.SizeMode = SizeMode.Fit
End Select
RemoveHandler viewer.SizeModeChanged, AddressOf viewer_SizeModeChanged
End Sub
Products |
Support |
Feedback: OnSizeModeChanged Method (ImageBox) - Leadtools.Windows.Controls |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.