这个程序

源代码在线查看: 频数统计f3(窗体模块frmfuzz).frm

软件大小: 124 K
上传用户: lwc_1978
关键词: 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				VERSION 5.00
				Begin VB.Form frmFuzz 
				   Appearance      =   0  'Flat
				   BackColor       =   &H80000005&
				   Caption         =   "求隶属度"
				   ClientHeight    =   3075
				   ClientLeft      =   60
				   ClientTop       =   345
				   ClientWidth     =   4680
				   LinkTopic       =   "Form1"
				   ScaleHeight     =   3075
				   ScaleWidth      =   4680
				   StartUpPosition =   3  '窗口缺省
				   Begin VB.CommandButton cmdNew 
				      Caption         =   "清除"
				      BeginProperty Font 
				         Name            =   "隶书"
				         Size            =   21.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      Height          =   495
				      Left            =   1680
				      TabIndex        =   6
				      Top             =   2400
				      Width           =   1215
				   End
				   Begin VB.CommandButton cmdExit 
				      Caption         =   "退出"
				      BeginProperty Font 
				         Name            =   "隶书"
				         Size            =   21.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      Height          =   495
				      Left            =   3120
				      TabIndex        =   3
				      Top             =   2400
				      Width           =   1335
				   End
				   Begin VB.CommandButton cmdCalc 
				      Caption         =   "计算"
				      BeginProperty Font 
				         Name            =   "隶书"
				         Size            =   21.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      Height          =   495
				      Left            =   240
				      TabIndex        =   2
				      Top             =   2400
				      Width           =   1215
				   End
				   Begin VB.TextBox txtU0 
				      Alignment       =   2  'Center
				      Appearance      =   0  'Flat
				      BeginProperty Font 
				         Name            =   "宋体"
				         Size            =   15.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      Height          =   495
				      Left            =   2400
				      TabIndex        =   0
				      Top             =   600
				      Width           =   1575
				   End
				   Begin VB.Label lblFF 
				      Alignment       =   2  'Center
				      Appearance      =   0  'Flat
				      BackColor       =   &H80000005&
				      BorderStyle     =   1  'Fixed Single
				      BeginProperty Font 
				         Name            =   "宋体"
				         Size            =   15.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      ForeColor       =   &H80000008&
				      Height          =   495
				      Left            =   2400
				      TabIndex        =   5
				      Top             =   1440
				      Width           =   1575
				   End
				   Begin VB.Label lblF0 
				      Alignment       =   1  'Right Justify
				      Appearance      =   0  'Flat
				      BackColor       =   &H80000005&
				      Caption         =   "隶属度(U0)="
				      BeginProperty Font 
				         Name            =   "隶书"
				         Size            =   15.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      ForeColor       =   &H80000008&
				      Height          =   495
				      Left            =   120
				      TabIndex        =   4
				      Top             =   1440
				      Width           =   2175
				   End
				   Begin VB.Label lblU0 
				      Alignment       =   1  'Right Justify
				      Appearance      =   0  'Flat
				      BackColor       =   &H80000005&
				      Caption         =   "U0 ="
				      BeginProperty Font 
				         Name            =   "宋体"
				         Size            =   15.75
				         Charset         =   134
				         Weight          =   400
				         Underline       =   0   'False
				         Italic          =   0   'False
				         Strikethrough   =   0   'False
				      EndProperty
				      ForeColor       =   &H80000008&
				      Height          =   375
				      Left            =   1200
				      TabIndex        =   1
				      Top             =   600
				      Width           =   1095
				   End
				End
				Attribute VB_Name = "frmFuzz"
				Attribute VB_GlobalNameSpace = False
				Attribute VB_Creatable = False
				Attribute VB_PredeclaredId = True
				Attribute VB_Exposed = False
				'求隶属度窗体
				Option Explicit
				Dim sngU0 As Single, sngFF As Single
				Dim intI As Integer, intJ As Integer
				
				Private Sub Form_Load()
				    lblF0.Visible = False       '“隶属度 =”标签不可视
				    lblFF.Visible = False       '显示隶属度计算结果的标签不可视
				End Sub
				
				'计算
				Private Sub cmdCalc_Click()
				    If txtU0.Text = "" Then
				        MsgBox "必须提供U0值", , "无U0值错误"
				        Exit Sub
				    End If
				    lblF0.Visible = True        '“隶属度 =”标签可视
				    lblFF.Visible = True        '显示隶属度计算结果的标签可视
				    sngU0 = Val(txtU0.Text)     '取得需要计算隶属度的变数值
				    For intI = 1 To intZon
				        For intJ = 1 To intCCC
				            If sngU0 >= S((intI - 1) * intCCC + intJ, 1) And _
				               sngU0 				                sngFF = R((intI - 1) * intCCC + intJ, 2)
				'在标签中显示隶属度计算结果
				                lblFF.Caption = Val(sngFF)
				                Exit Sub
				            End If
				        Next intJ
				    Next intI
				    MsgBox "无法获得隶属度", , "U0值错误"
				End Sub
				
				'清除
				Private Sub cmdNew_Click()
				    lblF0.Visible = False       '“隶属度 =”标签不可视
				    lblFF.Visible = False       '显示隶属度计算结果的标签不可视
				    txtU0.Text = ""             '清除提供计算隶属度的变数值的文本框
				End Sub
				
				'退出
				Private Sub cmdExit_Click()
				    Unload Me                   '卸载当前窗体
				    frmCalc.Visible = True      '显示计算窗体
				End Sub
				
							

相关资源