Jump to content
xisto Community
Sign in to follow this  
randomdood

A Question: Where To Begin Programming?

Recommended Posts

Oops randomdood I forgot that you are new to prog.See in Visual Basic, use a File List Box (simply drag and drop it onto the form), set it's path to the folder you want to pic photos from. sayFile1.Path = "C:\Images"Now after that done, your list box will be populated with all the available files (images in this case).To get the name of each file (in order to run a slide show), do the following:1) Write a Dim statement in the general section of code.Dim ptr as Integer2) Now drag a Timer control from the tool box into your form. Double click the timer, the code section will appear. Also, set the timer's Interval property (see the property box) to whatever time gap you want between each picture (for slideshow). This can also be done thru code like:Timer1.Interval = 100001000 means 1 second. 10000 means 10 seconds.Set the enabled property of the Timer to false (so that it doesnt start from beginning).3) Write this code:if ptr <= List1.ListCount - 1 then Image1.Picture = LoadPicture(List1.Path & "\" & List1.List(ptr))else Timer1.Enabled = Falseend ifWe take a variable called ptr. Initially its 0. We start to increment it to work our way down the list of images. We check to see if it has crossed the total number of images in the folder, if not then show the current image, if yes then stop the timer.4) Now to execute the code through a command button do this add a push/command button to your form from the tool box. Double click it to open the source view.Private Sub Command1_click() wMedia.Open "C:\Music\MyMusic.mp3" Timer1.Enabled = TrueEnd SubFirst line opens the music file and starts playing it using the windows media player component.Second line simply enables the timer we coded earlier. That means the images will start to slide every 10 secs.In any case just pick up a good book on Visual Basic, and you will love programming. I don't know how many people know the fact that Windows got the maximum (80%) number of programs contributed to it via Visual Basic developers. Visual basic is the world's most popular language as of today, and will remain so due to its sheer ease and definite power in desktop application development.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.