One Cuckoo Short of a Nest Quick Links

News PoliticsReviews IT On A Friday Cabinet Unpacked
Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Friday, June 12, 2009

Friday Fun: Make Your Very Own Pointless Program

Digg this
Feel like whiling away ten minutes? What better way to do it than by making a program that will make your friends think you are uber-cool!

If there is any one point to this, it is a very basic tutorial of MS Visual BASIC 05/08.

The process and code are very simple and Visual BASIC 2005 or 2008 can be used. Download the example to see how it should work if you run into any difficulties.


1. Add two scroll bars (I used one vertical and one horizontal), four progress bars and two picture boxes (dimensions set to a size of 1,1) to a blank form. Assign an image to each picture box.

2. Add the following code to the scroll event of one of the scroll bars:

ProgressBar1.Value = VScrollBar1.Value

ProgressBar2.Value = VScrollBar1.Value

ProgressBar3.Value = VScrollBar1.Value

ProgressBar4.Value = VScrollBar1.Value

HScrollBar1.Value = VScrollBar1.Value

PictureBox1.Height = (VScrollBar1.Value * 1.3)

PictureBox2.Width = (HScrollBar1.Value * 1.3)


And this to the scroll event of the other scroll bar:

ProgressBar1.Value = VScrollBar1.Value

ProgressBar2.Value = VScrollBar1.Value

ProgressBar3.Value = VScrollBar1.Value

ProgressBar4.Value = VScrollBar1.Value

VScrollBar1.Value = HScrollBar1.Value

PictureBox1.Width = (HScrollBar1.Value * 1.3)

PictureBox2.Height = (VScrollBar1.Value * 1.3)

3. And that’s it! Have a little play and see what happens to the picture boxes when you drag each scrollbar. Add bits, play around with it. There are a large number of toolbox items that use the ‘value’ field that can be easily added to this. Go wild – there are no boundaries to a program without any purpose!

Download the One Cuckoo short of a Nest example. (http://www.freewebs.com/gpile/PointlessProgram.exe)

Wednesday, June 10, 2009

How To: Make Your Drive Stand Out

Digg this

Ever had to look twice to find the drive you are looking for in the ‘My Computer’ screen? With an icon file (*.ico) and some simple code this is made easy!

My ComputerWhere’s my Drive!? Sometimes it can be hard to find your drive in the “My Computer” window.

First you have to choose an icon; you can use one you have already, make your own or extract one from the Windows shell32.dll (c:/WINDOWS/System 32/shell32.dll) or other program. A great free program to create or extract icons for both Windows and Mac is IcoFX, available from http://www.icofx.ro. To create a new icon in IcoFX, click File>New, select your icon size (there is an automated process in IcoFX that can convert an icon into all sizes and colour depths that can be applied afterwards, but it is best to choose 48x48 or larger for resolution purposes) and start drawing!

IcoFX

Save your icon as a “Windows Icon ('*.ico)” and open Notepad or other such text editor.

Type the following code (where “icon.ico” is the full name of your icon):

[autorun]

icon=icon.ico

Save this file as “autorun.inf” to the root directory (eg: f:\) of the drive you wish to apply the icon to (It is a good idea to make this file hidden), and do the same for the icon itself. The icon may not show up until an eject or restart.

This can be applied to any Windows flash drive, CD ROM/DVD/HDDVD/BD (include all files on the disk), hard disk drive or SSD. It will not work on a network drive or floppy disk.

If you wish to place your icon in a folder other than the root directory of your drive, type the following (where “documents\icon.ico” is the path from the root folder of your icon):

[autorun]
icon=documents\icon.ico

Most Popular This Week on OCSN

Save the net from censorship!



Counter