Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
QuestionFile Encoding Pin
Sean_B6-Aug-07 4:22
Sean_B6-Aug-07 4:22 
AnswerRe: File Encoding Pin
Luc Pattyn6-Aug-07 4:37
sitebuilderLuc Pattyn6-Aug-07 4:37 
GeneralRe: File Encoding Pin
Sean_B6-Aug-07 5:26
Sean_B6-Aug-07 5:26 
QuestionPNG compression? Pin
Mad_Mike6-Aug-07 3:52
Mad_Mike6-Aug-07 3:52 
AnswerRe: PNG compression? [modified] Pin
PhilDanger6-Aug-07 4:11
PhilDanger6-Aug-07 4:11 
GeneralRe: PNG compression? Pin
Mad_Mike6-Aug-07 4:14
Mad_Mike6-Aug-07 4:14 
GeneralRe: PNG compression? Pin
PhilDanger6-Aug-07 4:29
PhilDanger6-Aug-07 4:29 
GeneralRe: PNG compression? Pin
Mad_Mike6-Aug-07 5:04
Mad_Mike6-Aug-07 5:04 
Questionexcel Pin
TAREQ F ABUZUHRI6-Aug-07 3:10
TAREQ F ABUZUHRI6-Aug-07 3:10 
AnswerRe: excel Pin
Nisar Inamdar6-Aug-07 3:13
Nisar Inamdar6-Aug-07 3:13 
GeneralRe: excel Pin
TAREQ F ABUZUHRI6-Aug-07 4:03
TAREQ F ABUZUHRI6-Aug-07 4:03 
AnswerRe: excel Pin
Vasudevan Deepak Kumar6-Aug-07 3:23
Vasudevan Deepak Kumar6-Aug-07 3:23 
AnswerRe: excel Pin
Giorgi Dalakishvili6-Aug-07 3:25
mentorGiorgi Dalakishvili6-Aug-07 3:25 
AnswerRe: excel Pin
Bhavesh Bagadiya6-Aug-07 4:26
Bhavesh Bagadiya6-Aug-07 4:26 
GeneralRe: excel Pin
\laddie6-Aug-07 4:29
\laddie6-Aug-07 4:29 
AnswerRe: excel Pin
\laddie6-Aug-07 4:27
\laddie6-Aug-07 4:27 
QuestionAdd variable to object reference Pin
Rick van Woudenberg6-Aug-07 2:30
Rick van Woudenberg6-Aug-07 2:30 
AnswerRe: Add variable to object reference Pin
Luc Pattyn6-Aug-07 2:52
sitebuilderLuc Pattyn6-Aug-07 2:52 
AnswerRe: Add variable to object reference Pin
Vasudevan Deepak Kumar6-Aug-07 3:24
Vasudevan Deepak Kumar6-Aug-07 3:24 
AnswerRe: Add variable to object reference Pin
\laddie6-Aug-07 3:33
\laddie6-Aug-07 3:33 
AnswerRe: Add variable to object reference Pin
Colin Angus Mackay6-Aug-07 3:44
Colin Angus Mackay6-Aug-07 3:44 
AnswerRe: Add variable to object reference Pin
Rick van Woudenberg6-Aug-07 4:04
Rick van Woudenberg6-Aug-07 4:04 
Thank you all for you swift reply.
Very true , new would create a new instance ( hence the name ). I can understand why this could be confusing. I will try to explain as good as I can why I would want this.

I create a new array of points, which I add to a ObjectList.

private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)<br />
        {<br />
foreach (DataGridViewRow SelectedRow in dataGridView.SelectedRows)<br />
{<br />
Points pt = new Points();<br />
pt.AddPoint(X,Y);<br />
RenderableObjects.Objects.Add(pt);<br />
}<br />
}


When I rerender the form, the points (X,Y) show on the screen. So everytime I click on a row in the datagridview, the method is called. However, everytime a new instance of Points() is added to the RenderableObjects list. But before adding the new X and Y point , I want the list to be cleared. This can be achieved by :

RenderableObjects.Objects.Remove(pt);

However you can't use this line in the same method, since a new reference is initiated and therefore the previous pt is not removed.

My though was ( and it was just a though ) : If I could add a variable to the new reference, I could specifically filter, something like :

private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)<br />
        {<br />
int x = 1;<br />
foreach (DataGridViewRow SelectedRow in dataGridView.SelectedRows)<br />
{<br />
points pt[x] = new Points();<br />
pt[x].AddPoint(X,Y);<br />
RenderableObjects.Objects.Add(pt[x]);<br />
int y = x -1 ;<br />
RenderableObjects.Objects.Remove(pt[y]);<br />
x++;<br />
}<br />
}


For obvious reasons , this code would not run 'cause you cannot use an array (x) size on a variable declaration. Like I said, it was just a thought. I hope I was able to clearify it a bit more.

Cheers
QuestionProblem about debuging Pin
kcynic6-Aug-07 2:29
kcynic6-Aug-07 2:29 
AnswerRe: Problem about debuging Pin
MIHAI_MTZ6-Aug-07 4:12
MIHAI_MTZ6-Aug-07 4:12 
GeneralRe: Problem about debuging Pin
kcynic7-Aug-07 15:18
kcynic7-Aug-07 15:18 

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.