Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
QuestionResolve UNC Names Pin
HahnTech27-Jun-06 12:13
HahnTech27-Jun-06 12:13 
AnswerRe: Resolve UNC Names Pin
Mike Poz27-Jun-06 14:12
Mike Poz27-Jun-06 14:12 
GeneralRe: Resolve UNC Names Pin
HahnTech27-Jun-06 18:44
HahnTech27-Jun-06 18:44 
GeneralRe: Resolve UNC Names Pin
Mike Poz28-Jun-06 8:13
Mike Poz28-Jun-06 8:13 
GeneralRe: Resolve UNC Names Pin
HahnTech28-Jun-06 8:30
HahnTech28-Jun-06 8:30 
QuestionInheritance Pin
Besinci27-Jun-06 11:24
Besinci27-Jun-06 11:24 
AnswerRe: Inheritance Pin
Wjousts27-Jun-06 11:31
Wjousts27-Jun-06 11:31 
GeneralRe: Inheritance Pin
Judah Gabriel Himango27-Jun-06 13:05
sponsorJudah Gabriel Himango27-Jun-06 13:05 
AnswerRe: Inheritance Pin
Elina Blank27-Jun-06 11:34
sitebuilderElina Blank27-Jun-06 11:34 
QuestionRe: Inheritance Pin
BoneSoft27-Jun-06 12:38
BoneSoft27-Jun-06 12:38 
Questionforms Pin
Mohammed Elkholy27-Jun-06 11:20
Mohammed Elkholy27-Jun-06 11:20 
AnswerRe: forms Pin
Jun Du27-Jun-06 13:36
Jun Du27-Jun-06 13:36 
QuestionHelp please: Naming the objects at runtime! Pin
Rojan Gh.27-Jun-06 11:17
professionalRojan Gh.27-Jun-06 11:17 
AnswerRe: Help please: Naming the objects at runtime! [modified] Pin
Wjousts27-Jun-06 11:28
Wjousts27-Jun-06 11:28 
AnswerRe: Help please: Naming the objects at runtime! Pin
Rojan Gh.28-Jun-06 2:35
professionalRojan Gh.28-Jun-06 2:35 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa27-Jun-06 13:28
Guffa27-Jun-06 13:28 
AnswerRe: Help please: Naming the objects at runtime! Pin
Rojan Gh.28-Jun-06 2:48
professionalRojan Gh.28-Jun-06 2:48 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa28-Jun-06 9:40
Guffa28-Jun-06 9:40 
AnswerRe: Help please: Naming the objects at runtime! [modified] Pin
Rojan Gh.28-Jun-06 12:08
professionalRojan Gh.28-Jun-06 12:08 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa28-Jun-06 20:14
Guffa28-Jun-06 20:14 
I would use a local variable to reference the picturebox that is created, so that I don't have to access it in the array all the time:
PictureBox pictureBox;

pictureBox = new PictureBox();
pictureBox.Name = "pictureBoxX" + x.ToString() + "Y" + y.ToString();
pictureBox.Width = 10;
pictureBox.Height = 10;
pictureBox.Left = x * 10;
pictureBox.Top = y * 10;
pictureBox.BorderStyle = BorderStyle.FixedSingle;
pictureBox.Click += new EventHandler(PictureBox_Click);
this.Controls.Add(pictureBox);
pictureBoxes[x, y] = pictureBox


You have forgotten to call Dispose on the Graphics object and the SolidBrush object when you are done with them.

Also, you should check if there already is an image in the picturebox, so that you can call Dispose on in after you replaced it.


---
b { font-weight: normal; }

QuestionOpen Web form from Mdi form Pin
Saamir27-Jun-06 11:16
Saamir27-Jun-06 11:16 
AnswerRe: Open Web form from Mdi form Pin
led mike27-Jun-06 11:20
led mike27-Jun-06 11:20 
QuestionEvaluating a mathematical equation from a string [modified] Pin
Xodiak27-Jun-06 10:33
Xodiak27-Jun-06 10:33 
AnswerRe: Evaluating a mathematical equation from a string Pin
Josh Smith27-Jun-06 10:49
Josh Smith27-Jun-06 10:49 
AnswerRe: Need a way to jump to record. [modified] Pin
PyroManiak27-Jun-06 10:40
PyroManiak27-Jun-06 10:40 

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.