请大家帮忙做几道很简单的VB题目

2025-02-26 01:12:18
推荐回答(2个)
回答1:

1. form_click 事件
form1.width=form1.width-100
form1.heigh=form1.heigh-100
form1.caption="窗体面积为:" & form1.width*form1.heigh

2. form_Load 事件
form1.caption="可移动窗体"
form_click 事件
form1.left=form1.left-100

3. text_lostfocus 事件
if len(text1.text)<>6 then
text1.setfouce
end if

回答2:

1.Private Sub Form_Click()
With Me
.Move .Left, .Top, .Width - 100, .Height - 100
.Caption = "(" & .Width & "," & .Height & ")"
End With
End Sub
2.Private Sub Form_Load()
Me.Caption = "可移动的窗体"
End Sub
Private Sub Form_Click()
Me.Left = Me.Left - 100
End Sub
3.Private Sub Text1_LostFocus()
If Len(Text1) <> 6 Then Text1.SetFocus
End Sub