Form1.frm
上传用户:dweric
上传日期:2022-07-22
资源大小:6k
文件大小:6k
源码类别:

绘图程序

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   7695
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   10875
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   7695
  10.    ScaleWidth      =   10875
  11.    StartUpPosition =   3  '窗口缺省
  12.    Begin VB.TextBox Text2 
  13.       BeginProperty Font 
  14.          Name            =   "宋体"
  15.          Size            =   26.25
  16.          Charset         =   134
  17.          Weight          =   400
  18.          Underline       =   0   'False
  19.          Italic          =   0   'False
  20.          Strikethrough   =   0   'False
  21.       EndProperty
  22.       Height          =   735
  23.       Left            =   2040
  24.       TabIndex        =   8
  25.       Top             =   4080
  26.       Width           =   1935
  27.    End
  28.    Begin VB.TextBox Text1 
  29.       BeginProperty Font 
  30.          Name            =   "宋体"
  31.          Size            =   26.25
  32.          Charset         =   134
  33.          Weight          =   400
  34.          Underline       =   0   'False
  35.          Italic          =   0   'False
  36.          Strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   735
  39.       Left            =   2040
  40.       TabIndex        =   7
  41.       Top             =   2880
  42.       Width           =   1935
  43.    End
  44.    Begin VB.PictureBox Picture1 
  45.       Height          =   3735
  46.       Left            =   4440
  47.       ScaleHeight     =   3675
  48.       ScaleWidth      =   6315
  49.       TabIndex        =   4
  50.       Top             =   1560
  51.       Width           =   6375
  52.    End
  53.    Begin VB.CommandButton Command3 
  54.       Caption         =   "结束"
  55.       BeginProperty Font 
  56.          Name            =   "宋体"
  57.          Size            =   21.75
  58.          Charset         =   134
  59.          Weight          =   400
  60.          Underline       =   0   'False
  61.          Italic          =   0   'False
  62.          Strikethrough   =   0   'False
  63.       EndProperty
  64.       Height          =   855
  65.       Left            =   7680
  66.       TabIndex        =   3
  67.       Top             =   6240
  68.       Width           =   1695
  69.    End
  70.    Begin VB.CommandButton Command2 
  71.       Caption         =   "清除"
  72.       BeginProperty Font 
  73.          Name            =   "宋体"
  74.          Size            =   21.75
  75.          Charset         =   134
  76.          Weight          =   400
  77.          Underline       =   0   'False
  78.          Italic          =   0   'False
  79.          Strikethrough   =   0   'False
  80.       EndProperty
  81.       Height          =   855
  82.       Left            =   4560
  83.       TabIndex        =   2
  84.       Top             =   6240
  85.       Width           =   1695
  86.    End
  87.    Begin VB.CommandButton Command1 
  88.       Caption         =   "绘图"
  89.       BeginProperty Font 
  90.          Name            =   "宋体"
  91.          Size            =   21.75
  92.          Charset         =   134
  93.          Weight          =   400
  94.          Underline       =   0   'False
  95.          Italic          =   0   'False
  96.          Strikethrough   =   0   'False
  97.       EndProperty
  98.       Height          =   855
  99.       Left            =   1440
  100.       TabIndex        =   1
  101.       Top             =   6240
  102.       Width           =   1695
  103.    End
  104.    Begin VB.ComboBox Combo1 
  105.       Height          =   300
  106.       ItemData        =   "Form1.frx":0000
  107.       Left            =   840
  108.       List            =   "Form1.frx":0010
  109.       TabIndex        =   0
  110.       Top             =   1800
  111.       Width           =   3255
  112.    End
  113.    Begin VB.Label Label3 
  114.       Caption         =   "Label3"
  115.       Height          =   615
  116.       Left            =   5880
  117.       TabIndex        =   9
  118.       Top             =   840
  119.       Width           =   3375
  120.    End
  121.    Begin VB.Label Label2 
  122.       Caption         =   "z="
  123.       BeginProperty Font 
  124.          Name            =   "宋体"
  125.          Size            =   26.25
  126.          Charset         =   134
  127.          Weight          =   400
  128.          Underline       =   0   'False
  129.          Italic          =   0   'False
  130.          Strikethrough   =   0   'False
  131.       EndProperty
  132.       Height          =   615
  133.       Left            =   960
  134.       TabIndex        =   6
  135.       Top             =   4080
  136.       Width           =   735
  137.    End
  138.    Begin VB.Label Label1 
  139.       Caption         =   "w="
  140.       BeginProperty Font 
  141.          Name            =   "宋体"
  142.          Size            =   26.25
  143.          Charset         =   134
  144.          Weight          =   400
  145.          Underline       =   0   'False
  146.          Italic          =   0   'False
  147.          Strikethrough   =   0   'False
  148.       EndProperty
  149.       Height          =   615
  150.       Left            =   960
  151.       TabIndex        =   5
  152.       Top             =   2880
  153.       Width           =   735
  154.    End
  155. End
  156. Attribute VB_Name = "Form1"
  157. Attribute VB_GlobalNameSpace = False
  158. Attribute VB_Creatable = False
  159. Attribute VB_PredeclaredId = True
  160. Attribute VB_Exposed = False
  161. Private Sub Command1_Click()
  162. Dim x!, y!, z!, c!, w As Single
  163. Dim a
  164. x = 0.01
  165. w = Text1.Text
  166. z = Text2.Text
  167. c = w * x
  168. Do
  169. If x = 5000 Then
  170. Exit Do
  171. Else
  172. Select Case Combo1.ListIndex
  173. Case 0
  174. y = 500 * Sin(w * x * 3.1415926 / 180) + 500 * z + 1500
  175. Case 1
  176. y = 500 * Cos(w * x * 3.1415926 / 180) + 500 * z + 1500
  177. Case 2
  178. y = 50 * Tan(w * x * 3.1415926 / 180) + 50 * z + 1500
  179. Case 3
  180. If c = 0 Then
  181. a = MsgBox("无效数字", 16, "警告")
  182. Exit Do
  183. Else
  184. y = 150 / Tan(w * x * 3.1415926 / 180) + 150 * z + 1500
  185. End If
  186. End Select
  187. Picture1.PSet (x, y)
  188. x = x + 0.01
  189. End If
  190. Loop While x <= 5000
  191. End Sub
  192. Private Sub Command2_Click()
  193. Picture1.Cls
  194. End Sub
  195. Private Sub Command3_Click()
  196. Unload Me
  197. End Sub