+ 2
C# windows form application, how to allow user to select thier own picture?
I am creating an application for myself to help me with my work. I need to be able to add images with price and name and also be able to remove them. I have the basics down but are there any source codes to help me figure this out or tutorials.
3 ответов
+ 2
Good question. The Image control does not have a isselected property.
It does have a onclick event. If the you use this event, you can create a isselected property yourself, by toggle.
You could also use the tag-property.
If the images are in a list. You can use a image-listbox.
Also have a look at listview
It is kind of a advanced topic in winforms, wpf is better suited for this.
There are also some third components that can do this, but those are not free.
+ 1
I have figured it out some of it which includes as a user being able to upload a picture to form using the
OpenFileDialog()
+ 1
In your project you need database
1- create a class with parameter you need
2- use entity framework
3- create new form to get data from user
4- use open file dialog and get file name then this code to upload image
Bitmap bitmap = new Bitmap(imagePath);
Finally Add data to data base