Click here to Skip to main content
15,896,726 members

Comments by anthp (Top 12 by date)

anthp 1-May-23 19:35pm View    
Guys this is my code for loading the pictures, i have 24 blocks of this code, 1 for each datagridview row.
Is there a better way to load these pictures?

DataGridViewPics.Rows[21].Selected = true;
lblPicsSelectionLocation22.Text = DataGridViewPics.SelectedCells[0].Value.ToString();
String header21 = DataGridViewPics.SelectedCells[0].Value.ToString();
header21 = header21.Replace("mpg", "jpg").Replace("mpeg", "jpg").Replace("mp4", "jpg");
pictureBoxSongSelection22.ImageLocation = header21;
anthp 1-May-23 19:28pm View    
Sorry Dave, I just deleted your post by mistake.
anthp 1-May-23 19:26pm View    
Thank OriginalGriff,

If I may,

the 24 pictureboxes i am loading by pressing a button, eg press button 1, loads the first 24 pictures, press it again it loads the next 24 pictures and so on.

i am achieving this by:

int currentRow2 = DataGridViewPics.CurrentRow.Index;
this.DataGridViewPics.CurrentCell = this.DataGridViewPics[1, (CurrentRow2 + 1)];


this seems to work fine except also when i get to the end of the pictures, which could be 200 could be 500 i get the index out of range error.

is there a better way to achieve my method ?
anthp 1-May-23 19:26pm View    
Hi and thanks Dave.
anthp 19-Jun-13 2:50am View    
Hi Clifford
Thanks for you advise i hope this is better
I am not sure about the pre tags

cheers

Tony