Making a picture browser in VB 6

Adding the Controls

Click the maximize button on the form displayed (pic1), that will enlarge the form which is resized to be of a smaller size by default, our application is going to me in the maximized format, and at design time we need to see the whole of the form.  

 

(Remember, the maximize button you have to click is on the form, not the Visual Basic’s IDE). Set the window state property of the form to maximized, and caption property to ‘Picture Browser’ using the properties pane. Its time now to place our controls.  

 

As you already know, taking your mouse to a control’s picture will display the tooltip text with the name of the control. (Refer Pic2 for location of controls). Place the drive list box to the upper right corner of the form, beneath it place the directory list box and file list box respectively. In the rest of the left pane, place the picture box control; resize it to fill the entire space left. If you have some nice icons in your hard disk, its not a bad idea to change the default icon to something more meaningful and nice looking, but here we assume that we are still working with the default icon. Your form should like pic3 by now: (Note: the big box on the left hand side is the picture box, the length of the file list box is increased to fill the alignment requirements of our application, its up to you to size it the way you like, the your aesthetic sense works!).  

 

The space we have left at the bottom is for you to try out some things, example putting some introductory text of yourself, using the label control. With this GUI attained, we have completed exterior designing of our application, time now to wear the cap of interior designer as well!  

Firstly, we have to keep in mind that we have ‘not’ changed any of the default names of controls on our form. Their names are given below:

Name Control
Drive1 Drive list box
Dir1 Directory list box
File1 File list box
Picture1 Picture Box

These names will be referred in our coding. You can take a test drive if you like of the current ‘bare’ code less program by pressing F5 or by Run>Start. What you will see is interesting enough to catch attention. You current path is the one that is giving the data to all the controls (except the picture one). The drive and directory of your Visual Basic will appear in drive and directory boxes, and the files of current directory in the file list box. But, upon changing the drive in directory box, nothing will happen. Same goes for directory box; yes, you can change the directories and navigate the directory structure only of the current drive but file list wont be updated, neither, changing the directory will result in population of proper directories in directory box. To sum it all, all the three entities are working entirely on their own, irrespective of each other’s contents. Our task is to make them ‘realize’ that this is not good!  

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“My definition of an expert in any field is a person who knows enough about what's really going on to be scared.” - P. J. Plauger