- We need to create a new Module, we will call it [evry1falls], we will use this module to write the code which we need to use globally in the application, meaning (Any code we write there as Global will affect at any area of the application). We create new module by going to the (Project panel then right click then choose Add then Module), don't forget to save it as (evry1falls) in your main vb6 project (\PhoneBook) folder
first line we write there will be :
- PicNm is a string we will use to store the picture path which we will be assigned to our friends, also the string variable PicNm will hold the path of the picture in the Image control (Timg) everytime we want to use it, as in DragDrop method we will use below in the next step.
- We have an [Image] control called [Timg] and we use a [CommonDialog] object to load pictures of our friends in it. We can also use Drag/Drop event to accomplish this task, notice that using Drag/Drop pictures from our hard drive to the visual basic 6 IDE form is not so hard, you just need to understand that we will use OleDrop event of the Image control (Timg) , using this code below :