Iconos

22/09/2004 - 19:19 por José Miguel Torres | Informe spam
Hola, necesito hacer algo para seleccionar iconos, algo
así como lo tiene el messeger, que precionas un boton y se
te despligan los iconos gestuales.

Muchas gracias.
 

Leer las respuestas

#1 Alejandro Perez
22/09/2004 - 22:12 | Informe spam
Hola jose, como estas? aqui te hice algo muy simple para
lo que necesitas... es mas o menos para que tomes la idea
y lo perfecciones... pega este codigo en un archivo .cs de
un project windows. Y en C:\ d tu maquina, crea 5 gif con
5 iconos gestuales (smile1.gif smile5.gif)

Avisame si te sirve d algo.. nos vemos...

Alejandro Perez
MCSD/MCDBA/MCT
Caracas - Venezuela


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WinFileChange
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox
picMostrarIconos;
private System.Windows.Forms.Panel
pnlIconos;
private System.Windows.Forms.PictureBox
pictureBox1;
private System.Windows.Forms.PictureBox
pictureBox2;
private System.Windows.Forms.PictureBox
pictureBox3;
private System.Windows.Forms.PictureBox
pictureBox4;
private System.ComponentModel.Container
components = null;

public Form1()
{
InitializeComponent();
}

protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose
();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated
code
private void InitializeComponent()
{
System.Resources.ResourceManager
resources = new System.Resources.ResourceManager(typeof
(Form1));
this.picMostrarIconos = new
System.Windows.Forms.PictureBox();
this.pnlIconos = new
System.Windows.Forms.Panel();
this.pictureBox4 = new
System.Windows.Forms.PictureBox();
this.pictureBox3 = new
System.Windows.Forms.PictureBox();
this.pictureBox2 = new
System.Windows.Forms.PictureBox();
this.pictureBox1 = new
System.Windows.Forms.PictureBox();
this.pnlIconos.SuspendLayout();
this.SuspendLayout();
//
// picMostrarIconos
//
this.picMostrarIconos.Location =
new System.Drawing.Point(144, 80);
this.picMostrarIconos.Name
= "picMostrarIconos";
this.picMostrarIconos.Size = new
System.Drawing.Size(24, 24);
this.picMostrarIconos.TabIndex = 0;
this.picMostrarIconos.TabStop =
false;
this.picMostrarIconos.Click += new
System.EventHandler(this.picMostrarIconos_Click);
//
// pnlIconos
//
this.pnlIconos.BorderStyle =
System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlIconos.Controls.Add
(this.pictureBox4);
this.pnlIconos.Controls.Add
(this.pictureBox3);
this.pnlIconos.Controls.Add
(this.pictureBox2);
this.pnlIconos.Controls.Add
(this.pictureBox1);
this.pnlIconos.Location = new
System.Drawing.Point(80, 24);
this.pnlIconos.Name = "pnlIconos";
this.pnlIconos.Size = new
System.Drawing.Size(80, 56);
this.pnlIconos.TabIndex = 1;
this.pnlIconos.Visible = false;
//
// pictureBox4
//
this.pictureBox4.Location = new
System.Drawing.Point(48, 32);
this.pictureBox4.Name
= "pictureBox4";
this.pictureBox4.Size = new
System.Drawing.Size(24, 24);
this.pictureBox4.TabIndex = 3;
this.pictureBox4.TabStop = false;
this.pictureBox4.Click += new
System.EventHandler(this.pictureBox1_Click);
//
// pictureBox3
//
this.pictureBox3.Location = new
System.Drawing.Point(8, 32);
this.pictureBox3.Name
= "pictureBox3";
this.pictureBox3.Size = new
System.Drawing.Size(24, 24);
this.pictureBox3.TabIndex = 2;
this.pictureBox3.TabStop = false;
this.pictureBox3.Click += new
System.EventHandler(this.pictureBox1_Click);
//
// pictureBox2
//
this.pictureBox2.Location = new
System.Drawing.Point(48, 8);
this.pictureBox2.Name
= "pictureBox2";
this.pictureBox2.Size = new
System.Drawing.Size(24, 24);
this.pictureBox2.TabIndex = 1;
this.pictureBox2.TabStop = false;
this.pictureBox2.Click += new
System.EventHandler(this.pictureBox1_Click);
//
// pictureBox1
//
this.pictureBox1.Location = new
System.Drawing.Point(8, 8);
this.pictureBox1.Name
= "pictureBox1";
this.pictureBox1.Size = new
System.Drawing.Size(24, 24);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new
System.EventHandler(this.pictureBox1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.BackColor =
System.Drawing.Color.White;
this.ClientSize = new
System.Drawing.Size(240, 109);
this.Controls.Add(this.pnlIconos);
this.Controls.Add
(this.picMostrarIconos);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new
System.EventHandler(this.Form1_Load);
this.pnlIconos.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender,
System.EventArgs e)
{
//Carga de las imagenes, asegurate
que existan los smiles en esa ruta
pictureBox1.Image=Image.FromFile
(@"C:\smile1.gif");
pictureBox2.Image=Image.FromFile
(@"C:\smile2.gif");
pictureBox3.Image=Image.FromFile
(@"C:\smile3.gif");
pictureBox4.Image=Image.FromFile
(@"C:\smile4.gif");

picMostrarIconos.Image=Image.FromFile
(@"C:\smile5.gif");
}

private void picMostrarIconos_Click(object
sender, System.EventArgs e)
{
pnlIconos.Visible=!
pnlIconos.Visible;
}

private void pictureBox1_Click(object
sender, System.EventArgs e)
{
this.Text=((PictureBox)
sender).Name;
pnlIconos.Visible=false;
}


}
}





Hola, necesito hacer algo para seleccionar iconos, algo
así como lo tiene el messeger, que precionas un boton y


se
te despligan los iconos gestuales.

Muchas gracias.
.

Preguntas similares