会Visual Basic编程语言的人请进
我有一个程序,呢个程序系设计国际象棋的棋盘,但是运行不了,帮我看看问题的所在,先谢谢各位的回答!谢谢各位!!!Dimm%,n%,k%,shapel%shapel(0).H...
我有一个程序,呢个程序系设计国际象棋的棋盘,但是运行不了,帮我看看问题的所在,先谢谢各位的回答!谢谢各位!!!
Dim m%, n%, k%, shapel%
shapel(0).Height = 400
shapel(0).Width = 400
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m 展开
Dim m%, n%, k%, shapel%
shapel(0).Height = 400
shapel(0).Width = 400
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m 展开
5个回答
展开全部
这样改:另外 在窗体编辑状态下 把shapel控件的Index属性改为0
Dim m%, n%, k% 'shapel%删掉
shapel(0).Height = 400
shapel(0).Width = 400
shapel(0).FillStyle = 0'填充方式改为实心填充
shapel(0).Visible = False'控件数组0不可见
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m
Dim m%, n%, k% 'shapel%删掉
shapel(0).Height = 400
shapel(0).Width = 400
shapel(0).FillStyle = 0'填充方式改为实心填充
shapel(0).Visible = False'控件数组0不可见
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m
展开全部
'在窗体上放一个Shape 控件,名字叫做shapel , index 属性 设成0
Private Sub Form_Load()
Dim m%, n%, k% ', shapel(0 To 10) As Shape '**********
shapel(0).Height = 400
shapel(0).Width = 400
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m
End Sub
Private Sub Form_Load()
Dim m%, n%, k% ', shapel(0 To 10) As Shape '**********
shapel(0).Height = 400
shapel(0).Width = 400
For m = 1 To 10
For n = 1 To 10
k = (m - 1) * 10 + n
Load shapel(k)
shapel(k).Left = (n - 1) * 400
shapel(k).Top = (m - 1) * 400
If (m + n) Mod 2 = 0 Then
shapel(k).FillColor = &H0
Else
shapel(k).FillColor = &HFFFFFF
End If
shapel(k).Visible = True
Next n
Next m
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如果是不能运行的话你需要在窗体内放置一个Shapel控件,并设置名称为:Shape1,index 属性值设为0 ,然后将
Dim m%, n%, k% , shapel% 这句中的, shapel%去掉,改成:Dim m%, n%, k%
有程序中加载控件方法,呵,可我忘了,有谁知道,盼告诉一声。
Dim m%, n%, k% , shapel% 这句中的, shapel%去掉,改成:Dim m%, n%, k%
有程序中加载控件方法,呵,可我忘了,有谁知道,盼告诉一声。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
窗体内放置一个Shapel控件,并设置名称为:Shape1,index 属性值设为0 ,然后你程序中的Shape1都写成了ShapeL.所以将L该为1就ok.
如果要加上程序中设定的底色,需要将shape1的Drawstyle属性改为0-solid
如果要加上程序中设定的底色,需要将shape1的Drawstyle属性改为0-solid
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
提示什么啊?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询