我把我的图片上传不到附件上面!!
运行以下代码看看:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
Top = 0
Left = 0
Height = 472
Width = 576
DoCreate = .T.
Caption = "Form1"
Name = "form1"
ADD OBJECT check1 AS checkbox WITH ;
Top = 24, ;
Left = 24, ;
Height = 25, ;
Width = 73, ;
Alignment = 0, ;
Caption = "Check1", ;
Name = "Check1"
ADD OBJECT check2 AS checkbox WITH ;
Top = 60, ;
Left = 24, ;
Height = 13, ;
Width = 85, ;
Alignment = 0, ;
Caption = "Check2", ;
Name = "Check2"
ADD OBJECT text1 AS textbox WITH ;
Height = 25, ;
Left = 144, ;
Top = 36, ;
Width = 97, ;
Name = "Text1"
ADD OBJECT grid1 AS grid WITH ;
ColumnCount = 1, ;
Height = 312, ;
Left = 24, ;
Panel = 1, ;
Top = 144, ;
Width = 420, ;
Name = "Grid1", ;
Column1.Width = 192, ;
Column1.Name = "Column1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 84, ;
Left = 132, ;
Height = 37, ;
Width = 109, ;
Caption = "Command1", ;
Name = "Command1"
ADD OBJECT container1 AS container WITH ;
Top = 36, ;
Left = 288, ;
Width = 181, ;
Height = 73, ;
Name = "Container1"
PROCEDURE hidegrid
LPARAMETERS nButton, nShift, nXCoord, nYCoord
thisform.grid1.Visible = !thisform.grid1.Visible
ENDPROC
PROCEDURE Init
CREATE CURSOR kkk(序号 i)
INSERT INTO kkk VALUES (1)
INSERT INTO kkk VALUES (2)
INSERT INTO kkk VALUES (3)
GO TOP IN kkk
thisform.grid1.RecordSource="kkk"
thisform.grid1.coLUMN1.ControlSource="kkk.序号"
FOR EACH loObj IN THISFORM.OBJECTS
IF !LOWER(loObj.NAME) = "grid1"
BINDEVENT(loObj,"mousedown",THISFORM,"hideGrid")
ENDIF
ENDFOR
BINDEVENT(thisform,"mousedown",THISFORM,"hideGrid")
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************