Copyright: (C) Copyright 1995, Chris Haynes


Contents
Power Toolz Code Manager

Sample Library

CenterForm

Input_Box

MakeCtrl3D

MakeLabel3D

Drive_Ready

File_Exists


CenterForm

Example

Purpose:

Centers specified form on the screen.

Syntax:

Centerform {Form1}

Where Form1 is the form to be centered.


Input_Box

Example

Purpose:

Used as a replacement for the Windows Inputbox function.

Syntax:

Input_Box {Text}

Where Text is the caption that will appear in the box.


MakeCtrl3D

Example

Purpose:

Draws an inset 3D border around a standard Visual Basic control.  This routine creates the inset 3D effect seen in many text box  controls.  The effect looks best when the borderstyle of the textbox is set to none.

Syntax:

MakeCtrl3D {Control1, Form1}

Where Control1 is the control to draw the 3D border around, and  Form1 is the form to be centered.


MakeLabel3D

Example

Purpose:

Draws an inset 3D border around a standard Visual Basic label control.  This routine creates a raised or sunken 3D border the specified number of pixels wide.

Syntax:

MakeLabel3D {Form1, Control1, Width%, Style%}

Where:

Form1 is the form that contains the labe to be made 3D.

2Control1 is the control to draw the 3D border around.

Width% is the width of the 3D border in pixels.

Style% determines if the border is raised (0) or sunken (1).


Drive_Ready

Example

Purpose:

Determine if the specified drive letter is valid and present.

Syntax:

X% = Drive_Ready(Drive$)

Where Drive$ contains the drive letter to test for.

Return Value:

This function returns a true if the specified drive is present.


File_Exists

Example

Purpose:

Determines if the specified file name is exists.

Syntax:

X% = File_Exists(File$)

Where File$ is the file to test for.  The File$ string may also include a full path if required.

Return Value:

This function returns a true if the specified file is present.


CenterForm Example

Sub Form1_Load ( )

   CenterForm Me

End Sub


Input_Box Example

FullName$ = Input_Box("Please enter your full name")

If Len(FullName$) then

 MsgBox "You entered " + FullName$ + ".  Is this correct?", 32, "Name"

end if


MakeCtrl3D Example

Sub Form_Load ( )

'----- Draw 3D border around text box

MakeCtrl3D Text1, Me

End Sub


MakeLabel3D Example

Sub Form_Load ( )

'----- Draw 1 pixel 3D border around label

MakeLabel3D Me, Label1, 1, 1

End Sub


Drive_Ready Example

If Drive_Ready("A") then

   MsgBox "Drive A is ready", 64, "Drive Status"

end if


File_Exists Example
If File_Exists("A:\MYFILE.DAT") Then

   MsgBox "The file 'A:\MYFILE.DAT' exists", 64, "File Status"

End IF