15,896,726 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
anthp
16-Jun-13 3:31am
View
Deleted
Hi Philip and thanks for your replay
code is
private void ArtistDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (ArtistDataGrid.SelectedIndex >= 0)
{
var i = ArtistDataGrid.SelectedIndex.ToString();
System.Data.DataRowView lbi = (System.Data.DataRowView)ArtistDataGrid.SelectedValue;
var ArtistName = (lbi.Row[0].ToString());
labelArtistName.Content = ArtistName;
string WhichArtist = ArtistName;
juke_RWPF._VideoMusicjuke_RDataSet1_GroupSongByArtist _VideoMusicjuke_RDataSet1_GroupSongByArtist = ((juke_RWPF._VideoMusicjuke_RDataSet1_GroupSongByArtist)(this.FindResource("_VideoMusicjuke_RDataSet1_GroupSongByArtist")));
// Load data into the table GroupSongsByArtistqry. You can modify this code as needed.
juke_RWPF._VideoMusicjuke_RDataSet1_GroupSongByArtistTableAdapters.GroupSongsByArtistqryTableAdapter _VideoMusicjuke_RDataSet1_GroupSongByArtistGroupSongsByArtistqryTableAdapter = new juke_RWPF._VideoMusicjuke_RDataSet1_GroupSongByArtistTableAdapters.GroupSongsByArtistqryTableAdapter();
_VideoMusicjuke_RDataSet1_GroupSongByArtistGroupSongsByArtistqryTableAdapter.FillBy2(_VideoMusicjuke_RDataSet1_GroupSongByArtist.GroupSongsByArtistqry, WhichArtist);
System.Windows.Data.CollectionViewSource groupSongsByArtistqryViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("groupSongsByArtistqryViewSource")));
groupSongsByArtistqryViewSource.View.MoveCurrentToFirst();
{
{
string myArtistPic = "";
TextBlock x = SongGroupDataGrid.Columns[2].GetCellContent(SongGroupDataGrid.Items[0]) as TextBlock;
if (x != null)
//MessageBox.Show(x.Text);
myArtistPic = x.Text;
{
string MyString = (x.Text);
char[] MyChar = { 'g', 'p', 'm', '.', ' ' };
string NewString = MyString.TrimEnd(MyChar);
string ArtistPicture = ((NewString) + (".jpg"));
ImageSource imgsr = new BitmapImage(new Uri(ArtistPicture));
PictureBox1.Source = imgsr;
}
}
}
}
}
anthp
3-Jun-13 9:30am
View
Hi Prasad,
Thank you , I will go reading
Cheers
Tony
anthp
3-Jun-13 9:29am
View
Hi Kiran
Thank you, I will give a try and ask for more help if I need it
Cheers
Tony
anthp
2-Jun-13 17:57pm
View
Hi Sergey and thank you for you help
cheers
Tony
anthp
31-May-13 1:16am
View
Hi Amitosh
Thank you, i will go and have a read
anthp
23-Jan-13 20:41pm
View
Deleted
Moving forward
In my Access DB i have a table which holds the name of the Artist and also a list of all songs by that Artist eg if ACDC has 10 songs in my tbl then ACDC will be listed 10 times also in my tbl.
I now have a Listview called ArtistListView that displays the Artist Names
in the example of ACDC it is only listed once in my ArtistListView not 10 times as in the tbl.
I want to create a new Listbox / Listview and when I click on a Artist Name in my ArtistListView it displays all the songs associated with that Artist in my new Listbox / Listview.
I need some help please in direction of which is the best method to go about this.
I do have a relationship tbl in my Access DB which works fine but I dont know how to Bind it to my new Listbox / Listview or whether this is the best way.
Thanks
Cheers
Tony
anthp
17-Dec-12 16:46pm
View
Hi Tadit,
Thanks for your reply
cheers Tony
Show More