Usercontrol pyrowindow

Description

Je me suis amusé à copier le style de fenêtre d'un programme et je me suis dit que me faire un contrôle serai parfait et rapide par la suite pour mes applications suivantes!

Ce n'est pas très proprement nommé dans les propriétés mais de ce côté c'est pas mon truc :D

Il vous suffit pour l'utiliser, de:
- copier les trois fichiers dans le répertoire de votre application,
("PyroWindow.cs","PyroWindow.Designer.cs","PyroWindow.resx")
- et de l'ajouter "PyroWindow.cs" à votre projet tout simplement!

(Vous retrouverez le contrôle dans Custom Components)

Source / Exemple :


// Pour ce qui est des boutons de fenêtre (réduire/agrandir/fermer),
// Vous pouvez les activés facilement en suivant le code ci-dessous.
// Voici comment avoir l'évènement afin d'utiliser ceci (simple clique):

Exemple du contrôle ::

// 
// pyroWindow1
// 
this.pyroWindow1.BackColor = System.Drawing.Color.Transparent;
this.pyroWindow1.FondColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));
this.pyroWindow1.IconImage = ((System.Drawing.Image)(resources.GetObject("pyroWindow1.IconImage")));
this.pyroWindow1.Location = new System.Drawing.Point(12, 12);
this.pyroWindow1.Name = "pyroWindow1";
this.pyroWindow1.OmbreColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140)))));
this.pyroWindow1.Size = new System.Drawing.Size(260, 91);
this.pyroWindow1.TabIndex = 0;
this.pyroWindow1.Titre = "Titre de la fenêtre";
this.pyroWindow1.TitreAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.pyroWindow1.TitreColor = System.Drawing.Color.White;
this.pyroWindow1.TitreFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pyroWindow1.TitreImage = ((System.Drawing.Image)(resources.GetObject("pyroWindow1.TitreImage")));
this.pyroWindow1.TitreLayout = System.Windows.Forms.ImageLayout.Tile;
this.pyroWindow1.VisibleAgrandir = true;
this.pyroWindow1.VisibleFermer = true;
this.pyroWindow1.VisibleIcon = true;
this.pyroWindow1.VisibleReduire = true;
this.pyroWindow1.ReduireClick += new System.EventHandler(this.PyroWindow_ReduireClick);
this.pyroWindow1.AgrandirClick += new System.EventHandler(this.PyroWindow_AgrandirClick);
this.pyroWindow1.FermerClick += new System.EventHandler(this.PyroWindow_FermerClick);

// Les seules lignes qui nous intéresse sont les trois dernières
// Il vous fait les copier comme sur cet exemple à la fin des propriétés du contrôle
// Prenez seulement celles qui vous sont utile!

Voici maintenant les "void" ::

private void PyroWindow_ReduireClick(object sender, EventArgs e)
{
	// Lors du clique sur l'icône de diminution!
}

private void PyroWindow_AgrandirClick(object sender, EventArgs e)
{
	// Lors du clique sur l'icône de maximisation!
}

private void PyroWindow_FermerClick(object sender, EventArgs e)
{
	// Lors du clique sur l'icône de fermeture!
}

// Mettez ceci avec le reste des "void",
// Pour ceci aussi, prenez seulement le nécessaire.

Conclusion :


J'espère que mon tutoriel d'utilisation de mon petit contrôle ne vous a pas trop déplus!

Donnez-moi vos appréciations, je vous attend ;)

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.