设计题答案.docx
《设计题答案.docx》由会员分享,可在线阅读,更多相关《设计题答案.docx(12页珍藏版)》请在冰豆网上搜索。
![设计题答案.docx](https://file1.bdocx.com/fileroot1/2023-2/17/a7a8bdbb-8b93-4d8d-966a-246af760395a/a7a8bdbb-8b93-4d8d-966a-246af760395a1.gif)
设计题答案
设计题答案
解:
1、check1的click事件编写如下代码:
ifthisform.check1.value=1
mand1.enabled=.t.
else
mand1.enabled=.f.
endif
2、command1的click事件编写如下代码:
appeblank
repl学号with'200211'
repl姓名with'张三'
repl性别with'男'
repl出生日期with{^1983/06/28}
thisform.refresh
解:
command1的click事件编写如下代码:
a=val(thisform.text1.value)
b=val(thisform.text2.value)
n=0
ifa<=b
fori=atob
ifi%3=0
n=n+i
endif
endfor
else
fori=atobstep-1
ifi%3=0
n=n+i
endif
endfor
endif
thisform.text3.value=n
解:
command1的click事件编写如下代码:
a=thisform.text4.value
b=thisform.text5.value
c=(a+b)/2
ifc>=90
thisform.label1.caption='一等'
endif
ifc>=80andc<90
thisform.label1.caption='二等'
endif
ifc<80
thisform.label1.caption='无'
endif
解:
command1到command12的click事件编写如下代码:
thisform.text1.value=thisform.text1.value-'1'
thisform.text1.value=thisform.text1.value-'2'
thisform.text1.value=thisform.text1.value-'3'
thisform.text1.value=thisform.text1.value-'4'
thisform.text1.value=thisform.text1.value-'5'
thisform.text1.value=thisform.text1.value-'6'
thisform.text1.value=thisform.text1.value-'7'
thisform.text1.value=thisform.text1.value-'8'
thisform.text1.value=thisform.text1.value-'9'
thisform.text1.value=thisform.text1.value-'0'
thisform.text1.value=thisform.text1.value-'*'
thisform.text1.value=thisform.text1.value-'#'
解:
1、选中组合框,右击生成器,在列表项选项卡中添加work表中的“工号”字段,并在值选项卡中添加work表中的“工号”字段;
2、combo1的click事件编写代码如下:
s1=alltrim(thisform.Combo1.Value)
select姓名,基本工资,职称,部门号fromworkwhere工号=s1intoarraya
SELECT部门名FROMbmdmwhere部门号=a(4)intoarrayb
thisform.txt姓名.value=a
(1)
thisform.txt基本工资.value=a
(2)
thisform.txt职称.value=a(3)
thisform.text1.value=b
(1)
解:
command1的click事件编写代码如下:
a=val(thisform.text1.value)
b=val(thisform.text2.value)
ifthisform.optiongroup1.value=1
c=a+b
else
c=a-b
endif
thisform.text3.value=c
ifc<0
thisform.text3.forecolor=rgb(255,0,0)
else
thisform.text3.forecolor=rgb(0,0,255)
endif
解:
(方法一)command1的click事件编写代码如下:
ifthisform.opg1.value='电子'
SELECTAVG(Teach.基本工资);
FROMjsgl!
teachINNERJOINjsgl!
ddm;
ONTeach.系号=Ddm.系号;
WHEREDdm.系名='电子'intoarraya
endif
ifthisform.opg1.value='计算机'
SELECTAVG(Teach.基本工资);
FROMjsgl!
teachINNERJOINjsgl!
ddm;
ONTeach.系号=Ddm.系号;
WHEREDdm.系名='计算机'intoarraya
endif
ifthisform.opg1.value='机械'
SELECTAVG(Teach.基本工资);
FROMjsgl!
teachINNERJOINjsgl!
ddm;
ONTeach.系号=Ddm.系号;
WHEREDdm.系名='机械'intoarraya
endif
thisform.text1.value=a
(1)
(方法二)command1的click事件编写代码如下:
SELECTAVG(Teach.基本工资);
FROMjsgl!
teachINNERJOINjsgl!
ddm;
ONTeach.系号=Ddm.系号;
WHEREDdm.系名=thisform.opg1.valueintoarraya
thisform.text1.value=a
(1)
解:
command1的click事件编写代码如下:
a=val(thisform.text1.value)
b=(a-int(a))*1000
bai=int(b/100)
shi=int(b%100/10)
ge=b%10
thisform.text2.value=bai+shi+ge
解:
command1的click事件编写代码如下:
ifrecn()>1
skip-1
endif
if是否借出=.t.
thisform.check1.forecolor=rgb(0,0,128)
else
thisform.check1.forecolor=rgb(0,0,0)
endif
thisform.refresh
command2的click事件编写代码如下:
ifrecn()skip
endif
if是否借出=.t.
thisform.check1.forecolor=rgb(0,0,128)
else
thisform.check1.forecolor=rgb(0,0,0)
endif
thisform.refresh
解:
command1的click事件编写代码如下:
a=thisform.text1.value
b=thisform.text2.value
c=thisform.text3.value
d=thisform.text4.value
thisform.text5.value=round(a*b+c*d,1)
解:
command1的click事件编写代码如下:
locafor学校名称=allt(thisform.text1.value)
iffound()
thisform.label2.caption='欢迎到来'
mand2.enabled=.f.
else
thisform.label2.caption='库中暂缺,添加吗?
'
mand2.enabled=.t.
endif
command2的click事件编写代码如下:
appeblan
repl学校名称withthisform.text1.value
解:
command1到command12的click事件编写如下代码:
thisform.text1.value=thisform.text1.value-'1'
thisform.text1.value=thisform.text1.value-'2'
thisform.text1.value=thisform.text1.value-'3'
thisform.text1.value=thisform.text1.value-'4'
thisform.text1.value=thisform.text1.value-'5'
thisform.text1.value=thisform.text1.value-'6'
thisform.text1.value=thisform.text1.value-'7'
thisform.text1.value=thisform.text1.value-'8'
thisform.text1.value=thisform.text1.value-'9'
thisform.text1.value=thisform.text1.value-'0'
thisform.text1.value=thisform.text1.value-'+'
thisform.text1.value=thisform.text1.value-'-'
command13的click事件编写如下代码:
a=thisform.text1.value
l=len(a)
if'+'$a
b=at('+',a)
thisform.text1.value=str(val(subs(a,1,b-1))+val(subs(a,b+1,l)))
endif
if'-'$a
b=at('-',a)
thisform.text1.value=str(val(subs(a,1,b-1))-val(subs(a,b+1,l)))
endif