Implementing the ISupportIntegralResizing interface
In This Topic
The ISupportIntegralResizing interface indicates that the implementing control supports integral resizing. A control implementing the ISupportIntegralResizing interface can be resized according to the "preferred" height and width defined in the interface's implementation. If the interface is not implemented, the control will be resized pixel by pixel.
Implementation
Implementing the ISupportIntegralResizing interface implies that definitions for the following properties and methods are provided:
Returns the width required to fit the maximum number of items within the specified width.
The following example demonstrates how to use a UserControl (PictureViewer) that implements the ISupportIntegralResizing interface as a dropdown of a WinButton control. Both C# and VB.NET implementations of the PictureViewer class are provided.
VB.NET
Copy Code
Dim button As New WinButton button.ButtonType = New ButtonType( ButtonBackgroundImageType.Close, ButtonImageType.Plus )
button.Location = New Point( 10, 10 ) Me.Controls.Add( button )
Private Sub button_click( ByVal sender As Object, ByVal e As EventArgs ) CType( sender, WinButton ).DroppedDown = Not CType( sender, WinButton ).DroppedDown End Sub
C#
Copy Code
WinButton button = new WinButton(); button.ButtonType = new ButtonType( ButtonBackgroundImageType.Close, ButtonImageType.Plus );
ArrayList images = new ArrayList();
images.Add( new Bitmap( @"D:\images\first.bmp") ); images.Add( new Bitmap( @"D:\images\second.bmp") ); images.Add( new Bitmap( @"D:\images\third.bmp" ) ); images.Add( new Bitmap( @"D:\images\fourth.bmp") ); images.Add( new Bitmap( @"D:\images\fifth.bmp") ); images.Add( new Bitmap( @"D:\images\sixth.bmp") );
PictureViewer viewer = new Xceed.Editors.Samples.PictureViewer( images );
button.DropDownControl = viewer; button.Click += new EventHandler( this.button_click );
button.Location = new Point( 10, 10 ); this.Controls.Add( button );