Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: need help with implemnet conecction between c# app in windows to linux SLES 10 serve Pin
Sentenryu20-Apr-12 1:32
Sentenryu20-Apr-12 1:32 
GeneralRe: need help with implemnet conecction between c# app in windows to linux SLES 10 serve Pin
ronensv20-Apr-12 6:05
ronensv20-Apr-12 6:05 
GeneralRe: need help with implemnet conecction between c# app in windows to linux SLES 10 serve Pin
Sentenryu20-Apr-12 9:46
Sentenryu20-Apr-12 9:46 
GeneralRe: need help with implemnet conecction between c# app in windows to linux SLES 10 serve Pin
jschell20-Apr-12 10:23
jschell20-Apr-12 10:23 
QuestionHow to send array of objects to restful client as parameters Pin
NarVish19-Apr-12 22:09
NarVish19-Apr-12 22:09 
QuestionHow to register a new List<IChecker> to Actofac ContainerBuilder Pin
Johan Bertilsdotter19-Apr-12 21:25
Johan Bertilsdotter19-Apr-12 21:25 
AnswerRe: How to register a new List to Actofac ContainerBuilder Pin
Dave Kreskowiak20-Apr-12 3:30
mveDave Kreskowiak20-Apr-12 3:30 
Questioncreating event handler for picturebox click event Pin
Member 857219719-Apr-12 13:10
Member 857219719-Apr-12 13:10 
I have searched forums, Google, etc. and the examples provided do not work.
This is for a project I am working on.
The issue is creating event handler for click event
all else works and displays the pictureBoxes correctly

Code Snippet.

PictureBox pic = new PictureBox();
pic.Height = 150;
pic.Width = 150;
pic.Image = Utility.getPhoto(intPicID);

// get System.Drawing.Image from Picture Table
pic.Location = new System.Drawing.Point(intLeft, intTop);
pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
strBoxName = "PictureBox" + Convert.ToString(intW);
pic.Name = strBoxName;
pic.AllowDrop = true;
pic.TabStop = false;
pic.BorderStyle = BorderStyle.None;
if (clsGlobals.gbBorderStyle)
{
pic.BorderStyle = BorderStyle.Fixed3D;
}
//pic.Click += new System.EventHandler(pic_Click);
// if the preceeding line is un-commented the message
// the name pic_Click does not exist in the current context
clsGlobals.gstrPictureBoxNames[intW - 1] = pic.Name;
intW++;


PicBoxList.Add(pic);
}

// end of if
}

// end while

foreach (PictureBox pic in PicBoxList)
{
this.Controls.Add(pic);
//pic.Click += new System.EventHandler(pic_Click);
}


directives

using System;
using System.Windows;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;
using System.Data.SqlClient;
using System.Web;
AnswerRe: creating event handler for picturebox click event Pin
DaveyM6919-Apr-12 14:47
professionalDaveyM6919-Apr-12 14:47 
QuestionRe: creating event handler for picturebox click event Pin
Member 857219720-Apr-12 4:32
Member 857219720-Apr-12 4:32 
QuestionRe: creating event handler for picturebox click event Pin
DaveyM6920-Apr-12 6:23
professionalDaveyM6920-Apr-12 6:23 
AnswerRe: creating event handler for picturebox click event Pin
Member 857219720-Apr-12 6:36
Member 857219720-Apr-12 6:36 
AnswerRe: creating event handler for picturebox click event Pin
DaveyM6920-Apr-12 7:05
professionalDaveyM6920-Apr-12 7:05 
GeneralRe: creating event handler for picturebox click event Pin
Member 857219720-Apr-12 7:11
Member 857219720-Apr-12 7:11 
QuestionDodger Game in C# Pin
Qobacha19-Apr-12 9:26
Qobacha19-Apr-12 9:26 
AnswerRe: Dodger Game in C# Pin
Eddy Vluggen19-Apr-12 9:49
professionalEddy Vluggen19-Apr-12 9:49 
GeneralRe: Dodger Game in C# Pin
PIEBALDconsult19-Apr-12 12:00
mvePIEBALDconsult19-Apr-12 12:00 
GeneralRe: Dodger Game in C# Pin
Qobacha19-Apr-12 20:04
Qobacha19-Apr-12 20:04 
QuestionRe: Dodger Game in C# Pin
Eddy Vluggen20-Apr-12 0:43
professionalEddy Vluggen20-Apr-12 0:43 
GeneralRe: Dodger Game in C# Pin
Qobacha23-Apr-12 10:06
Qobacha23-Apr-12 10:06 
AnswerRe: Dodger Game in C# Pin
Eddy Vluggen23-Apr-12 11:09
professionalEddy Vluggen23-Apr-12 11:09 
GeneralRe: Dodger Game in C# Pin
Qobacha24-Apr-12 2:41
Qobacha24-Apr-12 2:41 
AnswerRe: Dodger Game in C# Pin
Eddy Vluggen24-Apr-12 4:55
professionalEddy Vluggen24-Apr-12 4:55 
GeneralRe: Dodger Game in C# Pin
Qobacha26-Apr-12 9:44
Qobacha26-Apr-12 9:44 
AnswerRe: Dodger Game in C# Pin
Eddy Vluggen26-Apr-12 9:54
professionalEddy Vluggen26-Apr-12 9:54 

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.