回复 20楼 茵梦湖
请问,你这是用RightClick事件中调用菜单实现的吧,插入的代码是用insert吗?
程序代码:
form_Stu = CREATEOBJECT("_Stu") form_Stu.Show READ EVENTS RETURN DEFINE CLASS _Stu AS Form AutoCenter=.T. BackColor=RGB(181,221,243) BorderStyle=0 Caption = "学生信息管理" Height=600 MaxButton=.F. ShowWindow=2 Width=800 WindowState = 0 ADD OBJECT XskGrid AS grid ADD OBJECT Sp as Shape WITH; Anchor = 240 BackStyle = 0 Height = 30 Width = 200 Left = (thisform.Width-this.Width)/2 Top = 10 ADD OBJECT Lb as Label WITH; Alignment = 2 Anchor = 240 AutoSize = .T. BackStyle = 0 Caption = "学生信息管理" FontBold = .T. FontSize = 12 Height = 20 Left = (thisform.Width-this.Width)/2 Top = 10 ADD OBJECT Img1 as Image WITH; BackStyle = 0 Height = 16 Width = 16 Left = thisform.Width-40 Top = 10 ADD OBJECT Img2 as Image WITH; BackStyle = 0 Height = 16 Width = 16 Left = thisform.Width-20 Top = 10 PROCEDURE Load USE h:\vfp\data\tables\xsk ORDER xh IN 0 ENDPROC PROCEDURE Arrange WITH This.XskGrid .RecordMark = .F. .Top = 50 .Left = 5 .Height = This.Height - .Top - 5 &&报错在这里,说表达式计算结果为一非法值。如果把ADD OBJECT Sp as Shape .Width = This.Width - .Left - 5 &&到ADD OBJECT Img2 as Image这几段代码去掉就不会报错。 ENDWITH WITH This.Img1.Click thisform.XskGrid.AllowCellSelection= .F. ENDWITH WITH This.Img2.Click thisform.XskGrid.AllowCellSelection= .T. thisform.Release ENDWITH ENDPROC PROCEDURE Activate This.Arrange ENDPROC PROCEDURE Resize This.Arrange ENDPROC PROCEDURE Unload CLEAR EVENTS CLOSE TABLES ALL ENDPROC ENDDEFINE