![]() ![]() ![]() ![]() There it goes, your traffic light is working!ħ Private Sub Timer1_Timer() If Shape1. Next you insert three shapes and set their shape properties to circle and fill the colors. Here I set it to 3000, which is equivalent to 3 seconds. In this program, you have to insert one timer and set its interval according to your wish. Private Sub Command1_Click() 'To clear the old graph pic_graph.Cls txt_a.Text = "" txt_b.Text = "" txt_c.Text = "" txt_d.Text = "" End Sub Private Sub Command2_Click() End End SubĦ 2- Traffic Light This Traffic Light program is a Visual Basic program. The cubic equation takes the form ax3+bx2+cx+dģ The Codes Private Sub cmd_draw_Click() Dim a, b, c, d As Integer Dim w, v As Double a = Val(txt_a.Text) b = Val(txt_b.Text) c = Val(txt_c.Text) d = Val(txt_d.Text) 'Using a scale of 0.5 cm to represent i unit to draw the graph ' Need to make some transformation as the coordinates in VB start from top left For w = 0 To 10 Step v = a * (5 - w) ^ 3 + b * (5 - w) ^ 2 + c * (5 - w) + d pic_graph.PSet (w, 5 - v) Next w End SubĤ Private Sub Command1_Click() 'To clear the old graph pic_graph This is a program that enable users to input the coefficients of a cubic equation and draw its graph. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |