Control.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Effectue le travail de définition des limites spécifiées de ce contrôle.
protected:
virtual void SetBoundsCore(int x, int y, int width, int height, System::Windows::Forms::BoundsSpecified specified);
protected virtual void SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified);
abstract member SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -> unit
override this.SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -> unit
Protected Overridable Sub SetBoundsCore (x As Integer, y As Integer, width As Integer, height As Integer, specified As BoundsSpecified)
Paramètres
- specified
- BoundsSpecified
Combinaison au niveau du bit des BoundsSpecified valeurs.
Exemples
L’exemple de code suivant remplace la SetBoundsCore méthode pour s’assurer que le contrôle reste une taille fixe. Cet exemple nécessite que vous disposiez d’une classe qui soit directement ou indirectement dérivée de la Control classe.
protected:
virtual void SetBoundsCore( int x, int y, int width, int height, BoundsSpecified specified ) override
{
// Set a fixed height and width for the control.
UserControl::SetBoundsCore( x, y, 150, 75, specified );
}
protected override void SetBoundsCore(int x, int y,
int width, int height, BoundsSpecified specified)
{
// Set a fixed height and width for the control.
base.SetBoundsCore(x, y, 150, 75, specified);
}
Protected Overrides Sub SetBoundsCore(x As Integer, _
y As Integer, width As Integer, _
height As Integer, specified As BoundsSpecified)
' Set a fixed height and width for the control.
MyBase.SetBoundsCore(x, y, 150, 75, specified)
End Sub
Remarques
En règle générale, les paramètres qui correspondent aux limites non incluses dans le specified paramètre sont transmis avec leurs valeurs actuelles. Par exemple, le Heightou Widthles XY propriétés de la Location propriété peuvent être transmis avec une référence à l’instance actuelle du contrôle. Toutefois, toutes les valeurs passées sont respectées et appliquées au contrôle.
Le boundsSpecified paramètre représente les éléments des contrôles modifiés Bounds par votre application. Par exemple, si vous modifiez le Size contrôle, la boundsSpecified valeur du paramètre est la Size valeur de BoundsSpecified. Toutefois, si la Size valeur est ajustée en réponse à la Dock propriété définie, la valeur du boundsSpecified paramètre est la None valeur de BoundsSpecified.
Note
Sur les systèmes Windows Server 2003, la taille d’un Form système est limitée par la largeur et la hauteur maximales de pixels du moniteur.
Notes pour les héritiers
En cas de SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) substitution dans une classe dérivée, veillez à appeler la méthode de la classe de SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) base pour forcer les limites du contrôle à modifier. Les classes dérivées peuvent ajouter des restrictions de taille à la SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) méthode.