Taille d'une fenêtre

MickeyCohen Messages postés 7 Date d'inscription vendredi 2 mai 2003 Statut Membre Dernière intervention 30 mai 2003 - 7 mai 2003 à 13:57
MickeyCohen Messages postés 7 Date d'inscription vendredi 2 mai 2003 Statut Membre Dernière intervention 30 mai 2003 - 30 mai 2003 à 17:06
Comment fait-on pour avoir une taille minimale de fenêtre lorsque l'on redimensionne celle-ci (si je redimensionne à fond une fenêtre je n'aurais que la barre des titres).

4 réponses

K@zuya Messages postés 306 Date d'inscription vendredi 21 février 2003 Statut Membre Dernière intervention 15 février 2016
7 mai 2003 à 14:07
form1.height = 0
form1.width = 0

K@zuya 8-)
0
Jujufouq Messages postés 254 Date d'inscription jeudi 27 décembre 2001 Statut Membre Dernière intervention 5 mars 2006
7 mai 2003 à 15:31
Si tu ne veux pas que l'utilisateur resize ta form en dessous d'une certaine limite, fait

Private Sub Form_Resize(...)
If Form1.Width < limiteLarg Then Form1.Width = limiteLarg
If Form1.Height < limiteHaut Then Form1.Height = limiteHaut
End Sub

J'espère que c'est la réponse que tu attendais. :)

Jujufouq
0
MickeyCohen Messages postés 7 Date d'inscription vendredi 2 mai 2003 Statut Membre Dernière intervention 30 mai 2003
27 mai 2003 à 08:42
J'aimerai surtout savoir comment gérer la souris ? Quand je réduit ma fenêtre au minimum, comment fait-on pour faire apparaître le curseur en forme de flèche et non pas le curseur en forme de double flèche (<->) ?
0
MickeyCohen Messages postés 7 Date d'inscription vendredi 2 mai 2003 Statut Membre Dernière intervention 30 mai 2003
30 mai 2003 à 17:06
J'ai résolu mon problème avec le code suivant ( à mettre dans une Form) :

Const LimiteLarg = 7000
Const LimiteHaut = 5000

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function SetCursorPos& Lib "user32" (ByVal X As Long, ByVal Y As Long)

Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
Const MOUSEEVENTF_WHEEL = &H80
Const MOUSEEVENTF_XDOWN = &H100
Const MOUSEEVENTF_XUP = &H200
Const WHEEL_DELTA = 120
Const XBUTTON1 = &H1
Const XBUTTON2 = &H2

Private Sub Form_Resize()

If Form1.Width < LimiteLarg Then
Form1.Width = LimiteLarg
Call mouse_event(MOUSEEVENTF_LEFTUP + MOUSEEVENTF_ABSOLUTE, Me.Left, Me.Top, 0, 0)
End If

If Form1.Height < LimiteHaut Then
Form1.Height = LimiteHaut
Call mouse_event(MOUSEEVENTF_LEFTUP + MOUSEEVENTF_ABSOLUTE, Me.Left, Me.Top, 0, 0)
End If

End Sub

Le problème est quand je redimensionne ma fenêtre en mettant le curseur sur la gauche ou sur le haut de la fenêtre, ma fenêtre se déplace. Comment fait-on pour qu'elle reste sur place ?

Nota : ce code source a été testé avec succès sous Windows xP mais à l'air de ne pas marché sous Windows 98 (pas testé sous les autres OS).

MickeyCohen.
0
Rejoignez-nous