Locate VB6.exe and Right-Click on it. Make sure you have the full privileges (Computer Administrator), choose Properties

VB6 Controls move slowly on Win7

Navigate to Compatibility section, and mark / activate the option (Run this program in compatibility mode for:) and then from the drop-down menu choose Windows XP (Service Pack3), also below in the settings section mark / activate the option Disable desktop composition.

Visual Basic 6.0 Controls move slow on Win7

Click OK and test your Visual Basic 6.0 IDE, place some controls on a VB6 Form, try to move those controls, you notice that the controls are no longer move slowly. Also, make sure you are Win7 computer admin before applying these options.

A running program isn't compatible with certain visual elements of Windows. Click here for more information.

Nothing to worry about here, the popped up message with close and Visual Basic 6.0 will work fine, and then when you exit Visual Basic 6.0 on Window7, the color schema will return to the default as before without any problems.

Problem :

Run-time error '70':Permission denied

Causes: An attempt was made to write to a write-protected disk or to access a locked file. This error has the following causes and solutions: Solution for WinXP :

(C) You tried to open a write-protected file for sequential Output or Append. (S) Open the file for Input or change the write-protection attribute of the file.

(C) You tried to open a file on a disk that is write-protected for sequential Output or Append. (S) Remove the write-protection device from the disk or open the file for Input.

(C) You tried to write to a file that another process locked. (S) Wait to open the file until the other process releases it.

(C) You attempted to access the registry, but your user permissions don't include this type of registry access. (S) On a 32-bit Microsoft Windows systems, a user must have the correct permissions for access to the system registry. Change your permissions or have them changed by the system administrator, as for Win7, see solution below ...

Solution for Win7:

Set Windows7 UAC [User Account Control] to [No Notifications] or just configureVB6.exe security for the Win7 current user to Full Control.

Save As .... your project in your (PhoneBook) folder on Desktop with the name (MyPhoneBook), or before saving, from (Project) , (Project Properties) , (General Tab) , (Project Title : MyPhoneBook) then from (Make Tab) , (Application Title : MyPhoneBook) then click (OK).

Save As .... your [Form1] from (Project Panel) in the same folder with the name (MainFrm), and go to the (Properties Panel) and change the Name property of the Form1 to (MainFrm). Close your project.

Your folder (PhoneBook) now should look like this
Folder (PhoneBook)
Now re-open the project and follow the following photo with notes on the design :
[MainFrm] form with controls placed on it, see the notes below.

Notes - numbers mark on the photo represent the following controls :

(1) Icon of the project : Created using VC++ and it is 32x32 Pixels, you will find it in the source code of the project in the end of the tutorial. We set the Icon of the project using the Main Form's Icon, from its [Icon] property, after putting the Icon file (Phone.Ico) in the main project folder (PhoneBook), Or we can set the form's Icon using this code :

Friday, February 22, 2013

Visual Basic Online Course

Temperature Convertor - Using Scroll Bars

Scroll Bar control is a very handy tool for Visual Basic programmers. It is used in many tricks like (sizing, scrolling texts .... etc)

Visual Basic ScrollBar example

Temperature Convector Desktop application source code project is a good example for Visual Basic beginners to start studying ScrollBars and how handy they are for a programmer as a tool on the form.

Scrollbars in Visual Basic 6.0 is free to use, easy to place on a form (Horizontally or Vertically) according to your need in the design-time (IDE), in our example we will place one Scrollbar on the form and some labels, TextBoxes and CommandButtons as in the photo below .

Temperature Convector VB6 Source Code

What is Celsius and Fahrenheit ?

- Celsius

is a scale and unit of measurement for temperature. It is named after the Swedish astronomer Anders Celsius (1701–1744), who developed a similar temperature scale. The degree Celsius (°C) can refer to a specific temperature on the Celsius scale as well as a unit to indicate a temperature interval, a difference between two temperatures or an uncertainty. The unit was known until 1948 as "centigrade" from the Latin centum translated as 100 and gradus translated as "steps".

- Fahrenheit

is a temperature scale based on one proposed in 1724 by, and named after, the physicist Daniel Gabriel Fahrenheit (1686–1736).[1] Within this scale, the freezing of water into ice is defined at 32 degrees, while the boiling point of water is defined to be 212 degrees - on Fahrenheit's original scale the freezing point of brine was zero degrees.

Tuesday, January 8, 2013

Visual Basic Online Course

Limit your application

Visual Basic Online Course - Limit Your Application

- Some applications are free trials and they're controlled using code. If you want to limit your application abilities on the client machine, then you will find those ideas great, regardless the Visual Basic Version I'm using VB6, you can still use them in .Net too.

1) Limit your VB6 Application to a certain number of times to run on the client's machine, seems sometimes to do the trick but it also can be modified easily, means your limitations can be broken easily if your client have some knowledge about programming or asked for help from a programmer. But as long as the idea is kept hidden and unknown inside the Source Code, then it would be hard to be discovered anyway. You can also limit your VB6 application setting a start Date and End Date instead of the values given in the source code below.

2) Limit your VB6application running once only. Some application can not run more than one interface specially those which connects to a Database because you don't want to duplicate connection to an already opened Database or Tables. You will need to limit your application to only run single instance or prevent your VB6Application from running more than once.
You will need to do those steps though,

Thursday, December 20, 2012

Visual Basic Online Course

How to change the ProgressBar colors by code

Progressbar

The ProgressBar control in Visual Basic 6.0 is replaced by the Windows Forms ProgressBar control in Visual Basic 2005. The names of some properties, methods, events, and constants are different, and in some cases there are differences in behavior.

Conceptual Differences

Negotiate Property

In Visual Basic 6.0, the Negotiate property of a ProgressBar control can be used to automatically hide the control when a toolbar is displayed.

The Visual Basic 2005 ProgressBar control does not have a Negotiate property; you can achieve the same effect by setting the Visible property to false at run time.

Orientation Property

In VB6, a Progress Bar control can be displayed either horizontally or vertically by setting the Orientation property. The Visual Basic 2005 ProgressBar control can only be displayed horizontally.

Monday, December 3, 2012

Visual Basic Online Course

Using Wild Cards when searching Database

Problem: I have 50 records of mobile phone numbers and they start with different digits according to network area code, I want to search the [MobileNo] record from [TextBox] so when I write the first digit i get some search result and the second digit returns the next search result .... etc as i go, using TextBox1_Change() event, i want when every time i type a digit i get a result in the DataGrid control

Solution: Using ADO + MS-Access 2003 + Sql Statements

That means : Search all records that contain these values within.
But, If you want to search for records start with certain values, then use :

And, If you want to search for records end with certain values, then use :