我知道你们说的问题是怎样的了,这是解决了的图片,下面是相关代码,你猜猜是在什么地方解决的:
程序代码:
Form1 = NEWOBJECT("C_Form") Form1.Show READ EVENTS RETURN DEFINE CLASS C_Form AS Form Caption = "改变Grid标题栏的颜色" ShowTips = .T. ADD OBJECT Grid1 AS Grid WITH Top = 20, Left = 20 ADD OBJECT Container1 AS Container WITH Top = 10, Left = 200, Width = 100, Height = 100, SpecialEffect = 0, BackColor = RGB(128,128,0) PROCEDURE Grid1.Init USE Unicode_GBK ALIAS test EXCLUSIVE IN 0 WITH This .RecordSourceType = 1 .RecordSource = "test" .Themes = .F. LOCAL lnIndex FOR lnIndex = 1 TO .ColumnCount WITH .Columns(lnIndex).Header1 .BackColor = RGB(0,0, 255) .ForeColor = RGB(255,255,255) ENDWITH NEXT ENDWITH ENDPROC PROCEDURE Grid1.AfterRowColChange(tnColumn) This.ZOrder(1) && 关键部位在这里! ENDPROC PROCEDURE Grid1.Show This.Visible = .T. ENDPROC PROCEDURE Grid1.Hide This.Visible = .F. ENDPROC PROCEDURE Grid1.Destroy USE IN test ENDPROC PROCEDURE Container1.Init WITH This .AddObject("Text1", "TextBox") .Text1.Top = 5 .Text1.Value = "点我显示表格" BINDEVENT(.Text1, "GotFocus", ThisForm.Grid1, "Show") .AddObject("Text2", "TextBox") .Text2.Top = 40 .Text2.Value = "点我隐藏表格" BINDEVENT(.Text2, "GotFocus", ThisForm.Grid1, "Hide") .SetAll("Left", 5, "TextBox") .SetAll("Height", 25, "TextBox") .SetAll("Width", 80, "TextBox") .SetAll("Visible", .T., "TextBox") ENDWITH ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC ENDDEFINE
[ 本帖最后由 TonyDeng 于 2012-6-2 00:17 编辑 ]
授人以渔,不授人以鱼。