回复 20楼 茵梦湖
请问,你这是用RightClick事件中调用菜单实现的吧,插入的代码是用insert吗?
2011-07-25 20:02
程序代码: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
2011-07-25 20:08

2011-07-25 20:13
2011-07-25 20:23
2011-07-25 20:31
2011-07-25 20:39
程序代码:
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
.Width = This.Width - .Left - 5
ENDWITH
ENDPROC
PROCEDURE Img1.Click
thisform.XskGrid.AllowCellSelection= .F.
ENDPROC
PROCEDURE Img2.Click
thisform.XskGrid.AllowCellSelection= .T.
thisform.Release
ENDPROC
PROCEDURE Activate
This.Arrange
ENDPROC
PROCEDURE Resize
This.Arrange
ENDPROC
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
PROCEDURE Unload
CLOSE TABLES ALL
ENDPROC
ENDDEFINE

2011-07-25 20:43
2011-07-25 20:46
程序代码: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
ADD OBJECT Lb as Label
ADD OBJECT Img1 as Image
ADD OBJECT Img2 as Image
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
.Width = This.Width - .Left - 5
ENDWITH
WITH This.Sp
.BackStyle = 0
.Height = 30
.Width = 200
.Left = (thisform.Width-200)/2
.Top = 10
ENDWITH
WITH This.Lb
.Alignment = 2
.AutoSize = .T.
.BackStyle = 0
.Caption = "学生信息管理"
.FontBold = .T.
.FontSize = 12
.Height = 20
.Left = (thisform.Width-100)/2
.Top = 15
ENDWITH
WITH This.Img1
.BackStyle = 0
.Height = 16
.Width = 16
.Left = thisform.Width-40
.Top = 10
ENDWITH
WITH This.Img2
.BackStyle = 0
.Height = 16
.Width = 16
.Left = thisform.Width-20
.Top = 10
ENDWITH
ENDPROC
PROCEDURE Img1.Click
thisform.XskGrid.AllowCellSelection= .F.
ENDPROC
PROCEDURE Img2.Click
thisform.XskGrid.AllowCellSelection= .T.
thisform.Release
ENDPROC
PROCEDURE Activate
This.Arrange
ENDPROC
PROCEDURE Resize
This.Arrange
ENDPROC
PROCEDURE Unload
CLEAR EVENTS
CLOSE TABLES ALL
ENDPROC
ENDDEFINE
2011-07-25 20:47

2011-07-25 20:53