We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 54,943 times

Contents

Related Categories

Making a picture browser in VB 6 - Adding the Controls

AliNizar

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!  

Comments

  • Re:

    Posted by aldutt01 on 30 Apr 2007

    I am really interested in your project. would you please mail the project  to  me.

    Thanking in anticipation.

    Anand Dutta
    aldutt01@gmail.com
    aldutt01@yahoo.com

  • VB Pic Preview

    Posted by twostars on 01 Jun 2005

    I am but a newbie to VB but I think you can only do text on dialog boxes.... if it were a picture on the form then I would do it the same as viewing it - only small....

  • Question

    Posted by mocolt on 28 Nov 2004

    I have a few problem with my VB and I'm hoping someone can help me.


    I want to add a Preview in a dlg box when a user is selecting an image. I have been searching for a code but it's so hard.
    ...

  • Picture Viwer

    Posted by PaulCyberHed on 19 Nov 2003

    Ellos

    i am making a picture view i have a list of file, o n a the F drive i need to change the driver letter?

    i also need to be able to view the pictures?

    Confus:p ed

  • Posted by CombatGold1 on 10 May 2003

    i've put up www.combatgold1.co.uk/VB for all my VB projects (with source files) - its not finished yet, but when i have time i'll finish it off