如何将数据网格视图记录与VB.NET中图片框中的图像连接? [英] How do I connect a datagridview record with an image in a picture box in VB.NET?
问题描述
我正在尝试为我的集合制作一个简单的界面。
我喜欢DataGridView的外观,并希望能够点击网格中的记录,并使此事件显示表格上的图片框中的特定图片。
要解决此问题,我至少需要帮助以获得这些项目:
1.如何在添加记录时保存图片到应用程序已知的图像目录?我想我会使用OpenFileDialogue吗?典型的情况是许多图片都会有爱因斯坦的名字,也就是说,应用程序如何自动在文件名中添加一个有区别的numbre?
2.如何连接 SciphiDataGridView .CurrentRow.Index 到正确的图像?
非常感谢提前。
Magnus
I'm trying to make a simple interface for my stampcollection.
I like the appearance of the DataGridView, and want to be able to click a record in the grid, and make this event show a specific picture in a picturebox on the form.
To solve this I need help with at least theese items:
1. How do I , when adding records, save pictures to an image catalogue known by the application? I guess I shold use an OpenFileDialogue? Typical situation is that many pictures will have the name "einstein", that is, how can the application automaticly add a discriminating numbre to the file name?
2. How do I connect the SciphiDataGridView.CurrentRow.Index to the correct image?
Thanks a lot in advance.
Magnus
推荐答案
Can I suggest you look at this article :
http://www.dreamincode.net/forums/topic/74114-a-really-simple-database
Its deals with adding and viewing images to a MS-SQL Server or Access Database using "OpenFileDialogue" and VB.net. You can easily modify the example to suit your application.
Hope it can help
这篇关于如何将数据网格视图记录与VB.NET中图片框中的图像连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!