Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
GeneralRe: CreateGraphics on a System.Image Pin
Christian Graus13-Nov-07 12:59
protectorChristian Graus13-Nov-07 12:59 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:05
codemunkeh13-Nov-07 13:05 
AnswerRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:06
sitebuilderLuc Pattyn13-Nov-07 13:06 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:09
codemunkeh13-Nov-07 13:09 
GeneralRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:16
sitebuilderLuc Pattyn13-Nov-07 13:16 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:35
codemunkeh13-Nov-07 13:35 
GeneralRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:45
sitebuilderLuc Pattyn13-Nov-07 13:45 
QuestionImages Click Event Problem... Pin
kingletas13-Nov-07 12:01
kingletas13-Nov-07 12:01 
I have this code that is showing a least 24 pictures, i just posted the code for 6, however i would like to know how to add an event for each one instead of one for all of them.

I considered doing:

P.Click += new EventHandler(cantPictures); which will have me to code a least 24 different events, but i don't know if that would be wise to do or if there is a more effiecient way to do it.


void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
int totalPics = loading.cant();



while (cantPictures < totalPics)
{
PictureBox P = new PictureBox();
Bitmap imag;

if(cantPictures <= 5)
{
if (cantPictures == 0)
{

imag = new Bitmap(images[cantPictures]);
P.Image = imag;
P.Click += new EventHandler(P_Click);
P.Size = new Size(150,150);

P.SizeMode = PictureBoxSizeMode.StretchImage;
P.Location = new Point(35, 10);
constante = 35 + P.Size.Width+10;
this.Controls.Add(P);

}

else
{

imag = new Bitmap(images[cantPictures]);
P.Image = imag;
P.Click += new EventHandler(P_Click);
P.Size = new Size(150, 150);
P.SizeMode = PictureBoxSizeMode.StretchImage;

P.Location = new Point( constante, 10);
constante += 10 + P.Size.Width;
this.Controls.Add(P);

}

}

Sorry, i just reply part of this message to one person in the forum but i thought i hit email instead...

Best regards...

Luis E Tineo S

AnswerRe: Images Click Event Problem... Pin
Luc Pattyn13-Nov-07 12:17
sitebuilderLuc Pattyn13-Nov-07 12:17 
GeneralRe: Images Click Event Problem... Pin
kingletas13-Nov-07 12:51
kingletas13-Nov-07 12:51 
GeneralRe: Images Click Event Problem... Pin
Luc Pattyn13-Nov-07 13:11
sitebuilderLuc Pattyn13-Nov-07 13:11 
GeneralRe: Images Click Event Problem... Pin
kingletas13-Nov-07 14:58
kingletas13-Nov-07 14:58 
QuestionImporting Extreamly Large Files Pin
jasper01813-Nov-07 11:58
jasper01813-Nov-07 11:58 
GeneralRe: Importing Extreamly Large Files Pin
jasper01813-Nov-07 12:46
jasper01813-Nov-07 12:46 
QuestionDateTime Compare Problem Pin
dataminers13-Nov-07 11:12
dataminers13-Nov-07 11:12 
AnswerRe: DateTime Compare Problem Pin
Christian Graus13-Nov-07 11:35
protectorChristian Graus13-Nov-07 11:35 
GeneralRe: DateTime Compare Problem Pin
dataminers13-Nov-07 11:45
dataminers13-Nov-07 11:45 
AnswerRe: DateTime Compare Problem Pin
Bino B13-Nov-07 21:44
Bino B13-Nov-07 21:44 
QuestionTo make button's backgroundimage enabled Pin
omegazafer13-Nov-07 11:02
omegazafer13-Nov-07 11:02 
GeneralRe: To make button's backgroundimage enabled Pin
omegazafer13-Nov-07 12:04
omegazafer13-Nov-07 12:04 
GeneralRe: To make button's backgroundimage enabled Pin
omegazafer13-Nov-07 13:18
omegazafer13-Nov-07 13:18 
QuestionCustom Pocket PC sync Pin
DaveyM6913-Nov-07 9:38
professionalDaveyM6913-Nov-07 9:38 
AnswerRe: Custom Pocket PC sync Pin
Vasudevan Deepak Kumar13-Nov-07 20:21
Vasudevan Deepak Kumar13-Nov-07 20:21 
GeneralRe: Custom Pocket PC sync Pin
DaveyM6913-Nov-07 22:59
professionalDaveyM6913-Nov-07 22:59 
QuestionUpdate, Delete On multi Tables Pin
mehrdadc4813-Nov-07 8:03
mehrdadc4813-Nov-07 8:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.