Visual Basic 6.0 translation

Showing posts with label Visual Basic Programming. Show all posts
Showing posts with label Visual Basic Programming. Show all posts

Sunday, May 26, 2013

Visual Basic Online Course - Controls move slowley on Win7-32, 64

Visual Basic 6 for Windows 7

VB6 on Win7
VB6 on Win7
Problem :
When Working with Visual Basic 6.0 on Win7-32 or Win7-64, the controls [TextBox, Labels, CommandButton ..... etc] placed on the vb 6.0 Form [VB6 IDE]  move slowly.
Solution :
Go to Visual Basic 6.0 main path (Microsoft Visual Studio on Main Partition), commonly is : C:\Program Files\Microsoft Visual Studio\VB98\
Locate VB6.exe and Right-Click on it. Make sure you have the full privileges (Computer Administrator), choose Properties
Visual Basic 6.0 on Windows 7 Problems
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.
Thank you for reading

Please watch the video if there is anything you did not understand .

Win7-32bit and Win7-64bit problem with Visual Basic 6.0. The controls move slow motion on the IDE Form.
Possible pop up message by Windows 7 :
Visual Basic 6.0 on Windows 7
 The color schema has been changed to Windows 7 Basic
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.

Monday, April 8, 2013

Visual Basic Online Course - Create a Phone Book

Visual Basic Help - Phone-Book
Microsoft Visual Basic 6.0 help and Tutorials
MS-Visual Basic 6.0 and MS-Access 2003 - Crystal Reports to create a desktop software professionally

Index .../
(1) Visual Basic 6.0 project design and controls

(2) MS-Access 2003 Database design


(3) Visual Basic 6.0 codes for design


(4) How does it work ?


(5) Visual Basic 6.0 code for MS-Access 2003


(6) Crystal Reports 4.6 for Visual Basic 6.0


(7) Building the desktop application


(8) Packing and Deploying the project


(9) Testing the Phone-Book application

(1) Visual Basic 6.0 project design & controls

  • Create a new folder on your desktop, name it (PhoneBook).
  • Open your Visual Basic 6.0, create new (Windows Applicatio).
  • 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 :

Microsoft visual basic help

Friday, February 22, 2013

Visual Basic Online Course - Temperature convector

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.

- Source Code

Saturday, February 16, 2013

Tuesday, January 8, 2013

Visual Basic Online Course - Prevent VB6 Application from run twice

Visual Basic Online Course

Limit your application

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 VB6 application 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 VB6 Application from running more than once.
You will need to do those steps though,
- Add Module Module1.bas, copy the following code into it.
- Then, from Menu Project, Project Properties, Start Up Object, choose Sub Main

You can also use the 1st example to prevent your application from running twice at the same time, but the second example is much more secure then the 1st one.

Thursday, January 3, 2013

Visual Basic Online Course - ListView, Element not found while removing items

Visual Basic Online Course

ListView,  Element not found while removing items

In VB6 If you tried to remove items from ListView Control, you may get this error :
Run-Time Error '35601':
 Element not found.

Example :

Code :

Error :
Executing the previous example will cause error '35601' when trying to remove the next Item from list view items.

Solution :
Simple error trap will fix the error



Tuesday, January 1, 2013

Visual Basic Online Course - Function Keys (F1 to F12)

Visual Basic Online Course

Function Keys


In VB6 ,in order to use the F-Keys (Function Keys) from your Keyboard or even any key, you need to set the form property [Key Preview] value to True .
Open new form [Form1]
Right-click on [Form1], View Code
The event [Form1_KeyDown]

Create Sub (I.E.: MyKey)

Go to [Form_KeyDown(KeyCode As Integer, Shift As Integer)], and write these lines:

Try out your application [Run your project] and after the form loads, press F5.


Thanx for reading

Tuesday, December 25, 2012

Visual Basic Online Course - Understanding the control resizing method

 Visual Basic Online Course

How does (Re-sizing) work ?

Download the example (MediaFire.com link)

Understanding how resizing controls work !

The basic Idea of resizing :

When resizing : Control Width grows and shrinks when form (Container) grows and shrinks with (Module). The (Modu) is the growing or shrinking Module ....

Let say we have  a control (Width = 10) on a form (Width = 20) then (Control : Width) = (10 : 20)

So when resizing the (form to = 40) then the (Control will grow to = ???) --------- Answer :
   ( 10 : 20 ) = ( ??? : 40)
   ??? = 20 , Why ?

Because the (Modu = [40 / 20]), then the ??? = 10 * Modu
??? = 20 ......... And so on ...

In the example attached you will notice that resizing the form with cause resizing the control as well.
Thanx for reading


Thursday, December 20, 2012

Visual Basic Online Course - ProgressBar Colors

Visual Basic Online Course

How to change the ProgressBar colors by code

Visual Basic Progressbar
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.

Create New (Module)


Then in the form_load() section



Monday, December 3, 2012

Visual Basic Online Course - WildCards in Database

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 :


Visual Basic Online Course

vb6 (63) Application Development (45) Visual Basic Online Course (45) Online Visual Basic Course (44) Visual Basic Help (44) Visual Basic Programming (42) IT Jobs (39) VB6 developer (38) Visual Basic Course (38) Visual Basic 6.0 (26) Microsoft Visual Basic 6.0 (25) VB6.0 (24) Visual Basic Programmers (24) vb 6.0 (24) visual basic programming tutorial (19) Third lesson (16) Source code download for Visual Basic 6.0 (14) Source code for Visual Basic 6.0 (10) visual basic tutorial (9) Visual Basic 6 (5) Visual Basic Courses (5) Lesson 3 (4) VB 0.6 - TreeView control (4) VB 0.6 With TreeView Control (4) VB6 Course (3) Create ActiveX (2) How to automate MS-Access from Visual Basic 6.0 (2) Add controls at runtime (1) Back up your Database (1) Change ActiveX icon (1) Change screen resolution (1) Create FTP (1) Crystal Reports 4.6 (1) Crystl32.ocx could not be loaded (1) DataGrid Columns re-size (1) Date Calculation (1) DateAdd Function (1) DateDiff function (1) FTP (1) Marquee Title Bar (1) Marquee VB 6.0 TitleBar (1) Method 'Action' of object 'CrystalCtrl' Failed (1) Microsoft Access with Visual Basic 6.0 (1) OpenSchema method (1) Save File Using CommonDilog (1) Track Database path (1) VB 0.6 - Registry (1) VB 0.6 With Registry Editor (1) VB 6.0 Access (1) VB 6.0 OOP (1) VB6 Access2003 ADO Like % (1) VB6 Add Date (1) VB6 Add Time (1) VB6 Date calculation (1) VB6 Subtract Date (1) Visual Basic Remote (1) Win7 (1) Windows7 (1) ms access networking details (1) remote Visual Basic DB (1) rounded and transparent forms (1) vb 0.6 style (1) vb 6.0 Remote Database (1)