
June 3rd, 2012, 02:56 PM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 4
Time spent in forums: 1 h 10 m 13 sec
Reputation Power: 0
|
|
|
Application for Gradient using VB .NET
Hie, here another application i've make, it's how to find a gradient. It helps a people who want to find the gradient the easy way just by looking at a graph. Have fun
Things needed:
6 Labels
4 Text boxes
3 Buttons
Here tare the CODE:
Code:
Function Gradient(A As Double, B As Double, C As Double, D As Double) As Double
Gradient = (A - C) / (B - D)
End Function
Private Sub Command1_Click()
Label4 = ((Text1.Text) - (Text2.Text)) / ((Text3.Text) - (Text4.Text))
End Sub
Private Sub Command2_Click()
Form_Load
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Label4.Caption = ""
End Sub
Here are the attributes:
Quote: VERSION 5.00
Begin VB.Form Form1
Caption = "Finding Gradient"
ClientHeight = 4470
ClientLeft = 2970
ClientTop = 3330
ClientWidth = 4440
LinkTopic = "Form1"
ScaleHeight = 4470
ScaleWidth = 4440
Begin VB.CommandButton Command3
Caption = "END"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 9
Top = 3120
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "Reset"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 8
Top = 2640
Width = 975
End
Begin VB.CommandButton Command1
Caption = "Calculate"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 7
Top = 2640
Width = 975
End
Begin VB.TextBox Text4
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 6
Top = 1440
Width = 375
End
Begin VB.TextBox Text3
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 5
Top = 1440
Width = 375
End
Begin VB.TextBox Text2
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 4
Top = 840
Width = 375
End
Begin VB.TextBox Text1
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 3
Top = 840
Width = 375
End
Begin VB.Label Label6
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "Gradient Finder"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 12
Top = 240
Width = 3015
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "Gradient ="
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 11
Top = 2040
Width = 1095
End
Begin VB.Label Label4
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 10
Top = 2040
Width = 2175
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "-----------------------------------"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 2
Top = 1200
Width = 1575
End
Begin VB.Label Label2
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "-"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 1
Top = 1440
Width = 375
End
Begin VB.Label Label1
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "-"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 0
Top = 840
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False |
|