Les Snippets

Connexion

Redimensionnement d'un formulaire sans bordure

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 28/05/2006 20:04:28 et initié par Charles Racaud [Liste]
Date de mise à jour : 28/05/2006 22:27:45
Vue : 6641
Catégorie(s) : WinForm
Langages dispo pour ce code :
- C# 1.x, C# 2.x
- VB 2005, VB.NET 1.x
- VB6
- VBA



Langage : C# 1.x , C# 2.x
Date ajout : 28/05/2006
Posté par Charles Racaud [Liste]

private const int WS_EX_STATICEDGE = 0x00020000;
private const int WS_SIZEBOX  = 0x00040000;
protected override System.Windows.Forms.CreateParams CreateParams
{
  get
  {
    System.Windows.Forms.CreateParams CP = base.CreateParams;
    CP.ExStyle =  WS_EX_STATICEDGE;
    CP.Style =  WS_SIZEBOX;
    return CP;
  }
}

Langage : VB.NET 1.x , VB 2005
Date ajout : 28/05/2006
Posté par Charles Racaud [Liste]

Private Const WS_EX_STATICEDGE As Integer = &H20000
Private Const WS_SIZEBOX As Integer = &H40000
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
  Get
    Dim CP As CreateParams = MyBase.CreateParams
    CP.ExStyle = WS_EX_STATICEDGE
    CP.Style = WS_SIZEBOX
    Return CP
  End Get
End Property

Langage : VB6
Date ajout : 03/12/2006
Posté par Charles Racaud [Liste]
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As LongByVal nIndex As LongByVal dwNewLong As LongAs Long
Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_STATICEDGE As Long = &H20000
Private Const WS_SIZEBOX As Long = &H40000
Private Sub Form_Initialize()
  SetWindowLong Me.hwnd, GWL_STYLE, WS_SIZEBOX
  SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_STATICEDGE
End Sub
Langage : VBA
Date ajout : 03/12/2006
Posté par Charles Racaud [Liste]
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As LongByVal nIndex As LongByVal dwNewLong As LongAs Long
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As StringByVal lpWindowName As StringAs Long

Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_STATICEDGE As Long = &H20000
Private Const WS_SIZEBOX As Long = &H40000
Private Sub UserForm_Initialize()
  Dim hwnd As Long
  hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*""X""D") & "Frame"Me.Caption)
  SetWindowLong hwnd, GWL_STYLE, WS_SIZEBOX
  SetWindowLong hwnd, GWL_EXSTYLE, WS_EX_STATICEDGE
End Sub

Snippets en rapport avec : Form, Resize, Redimensionnement, Bordure, Borderless



Codes sources en rapport avec : Form, Resize, Redimensionnement, Bordure, Borderless

{Visual Basic, VB6, VB.NET, VB 2005} REDIMENSIONNEMENT AUTOMATIQUE DU CONTENU D'UN FORM EN VB.NET
Je me suis inspiré d'un code déposé en CSharp.NET par "bestmomo" (http://www.csharpfr.com/code.aspx?...

{Visual Basic, VB6, VB.NET, VB 2005} FORM/WINDOW RESIZE
Adaptation d'un code Pour repositionner les composants d'une fenêtre sur Visual Basic .NET Le cod...

{Visual Basic, VB6, VB.NET, VB 2005} ANCRAGE DES CONTRÔLES SANS API, OCX, DLL...
Ce module de classe permet de redimensionner et/ou de déplacer les contrôles qui doivent rester à un...

{Visual Basic, VB6, VB.NET, VB 2005} FORM ARRONDI
Voici un mini programme qui permet de créer une form arrondi paramétrable. Il suffit d’entrer les pa...

{C# / C#.NET} IMAGE RESIZER (JPG) AVEC COMPRESSION
Salut chers CSharpiens; On connait tous du monde qui ont des superbes caméras numériques qui prenne...

{Visual Basic, VB6, VB.NET, VB 2005} MAGNÉTISATION ET DÉPLACEMENT D'UNE FEUILLE SANS BORDURE
Tous est dit dans le texte...

{Visual Basic, VB6, VB.NET, VB 2005} RESIZE UNE FORM SANS CLIGNOTEMENT MOCHE
Quand je veus limiter la taille minumum d'une form, j'utilise l'evenement Form_Resize et je change l...

{Visual Basic, VB6, VB.NET, VB 2005} BOUGER UNE FORM SANS BORDURE ( BORDERSTYLE = 0-NONE)
Comment faire pour que votre form soit bougeable sans cette horrible barre de MICROSOFT ...

{Visual Basic, VB6, VB.NET, VB 2005} DESSINER AVEC LA METHODE "DRAWIMAGE"
la methode "paintpicture" propre a VB6, simple et efficace ... ne semble plus marcher sur VB2005. j'...

{PHP} CLASSE DE TRAITEMENT D'IMAGE
Cette classe permet diverses opérations sur les images. Vous pourrez entre autres : - Redimensi...