Jump to content


Check out our Community Blogs

MathX

Member Since 18 Oct 2008
Offline Last Active Nov 28 2015 08:08 PM
-----

#424482 ProgressBar in VB6

Posted by MathX on 12 January 2009 - 01:30 AM

Hi all!

Today I am going to make another simple tutorial about how to make a progress bar in VB6.

First you must include some components. Go to Project – Components – (in the list choose) Microsoft Windows Common Controls 5.0.

You will see this now:

Posted Image



Now double click on form1 and drag-and-drop a PrograssBar, a timer and a Button.


It will look something like this:

Posted Image



On form_load (simply double click on the form and you will be ready to write the code) wrote this line on code.

Private Sub Form_Load()
ProgressBar1.Value = ProgressBar1.Min
End Sub

It sets the value of the ProgressBar at min.

First set the interval of the timer:

Posted Image


Now double click on the timer and write this:

Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 10
If ProgressBar1.Value = 50 Then
ProgressBar1.Value = ProgressBar1 + 50
If ProgressBar1.Value >= ProgressBar1.Max Then
Timer1.Enabled = False
End If
End If
End Sub

You probably understand this code. I wanted to make the progressbar faster from the middle of it.

Double click on the button (its name has been changed into “close”) and write:

Private Sub Command1_Click()
End
End Sub

It will close the program.

By MathX

Enjoy…
  • 6


#421851 Determinants Value

Posted by MathX on 03 January 2009 - 04:55 AM

This is a very simple tutorial that shows how to create a simple program in VB6 to calculate the value of a determinant.

First - Create 3 new forms.

On form1 put a combo box and change its text to "Choose"
Create a command button too and on the caption write "Go!"

Posted Image

As it is shown on the screen shot on the list write "2x2" and "3x3".

Posted Image

Double click on the button and write those lines of code:

Private Sub Command1_Click()
If Combo1 = "2x2" Then
Form2.Show
Else
Form3.Show
End If
Unload Me
End Sub

On form2 put 5 textboxes and a command button.
Change the caption of the Command button to "Calculate"

Posted Image

Double click on the Button and write this line of code:

Private Sub Command1_Click()
Text5 = Text1 * Text4 - Text2 * Text3
End Sub

This is the formula to calculate the value of 2x2 determinant.


On form3 put 10 textboxes and a command button.
Change the caption of the Command button to "Calculate".

Posted Image

Double click on the Button and write this line of code:

Private Sub Command1_Click()
Text10 = Text1 * Text5 * Text9 + Text3 * Text4 * Text8 + Text2 * Text6 * Text7 - Text3 * Text5 * Text7 - Text1 * Text6 * Text8 - Text2 * Text4 * Text9
End Sub

This is the formula to calculate the value of 3x3 determinant.


This is my first tutorial ever so, I apologize for any mistakes.

PS: Thanx to SaintLion
  • 8


#406079 Finally i Finished My Gradute

Posted by MathX on 12 November 2008 - 07:48 AM

R u happy?
  • -1


#399325 How to Find External IP (Static IP)

Posted by MathX on 24 October 2008 - 08:11 AM

Worked...
  • 1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download