|
3#
楼主 |
发表于 2006-12-17 01:18:00
|
只看该作者
(1)自定义是这样写的:
Function 展长(构造, 驳口 As String, 长, 宽, 高 As Single)
n = 构造
m = 驳口
a = 长
b = 宽
c = 高
If n = "平口盒" And m = "单驳" Then
展长 = (a + b) * 2 + 3
ElseIf n = "平口盒" And m = "双驳" Then
展长 = (a + b + 3) * 2
ElseIf n = "连体鞋盒" And m = "无驳" Then
展长 = 2 * b + c + 8
ElseIf n = "连体彩盒" And m = "无驳" Then
展长 = 2 * b + 2 * c + 2
ElseIf n = "扣底插盒" And m = "单驳" Then
展长 = (a + b) * 2 + 3
ElseIf n = "扣底插盒" And m = "双驳" Then
展长 = (a + b + 3) * 2
ElseIf n = "两头插盒" And m = "单驳" Then
展长 = (a + b) * 2 + 3
ElseIf n = "两头插盒" And m = "双驳" Then
展长 = (a + b + 5) * 2
ElseIf n = "手袋" And m = "单驳" Then
展长 = (a + b) * 2 + 3
ElseIf n = "手袋" And m = "双驳" Then
展长 = (a + b + 3) * 2
End If
(2)调用过程:在窗体设计状态下选择所用的"文本框",点击鼠标右键,选择属性的"数据"项的"控件来源",点击"控件来源"的生成哭器,再选择函数之模块,这样就把函数装进去的,请问老师,函数是否编写有错,调用过程是否不当?谢谢!
End Function
|
|