10楼没有看清楚楼主的需求啊
他是想得到两个界面供用户选择,
左半表格是起到一个类似父表的指针的作用,
右半边可以列表, 也可以编辑, 而Grid自带的编辑太丑了,
这才想出这么个招来.呵呵
这个思路应该说非常好, 只是被bug给卡住了.
他是想得到两个界面供用户选择,
左半表格是起到一个类似父表的指针的作用,
右半边可以列表, 也可以编辑, 而Grid自带的编辑太丑了,
这才想出这么个招来.呵呵
这个思路应该说非常好, 只是被bug给卡住了.
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 WITH This .ColumnCount = 5 .Themes = .F. .HeaderHeight = 40 WITH .Columns(1).Header1 .BackColor = RGB(0,0, 255) .ForeColor = RGB(255,255,255) ENDWITH WITH .Columns(2) .RemoveObject("Header1") .AddObject("Header1", "C_Header") .Header1.Caption = "超长的标题栏测试" ENDWITH ENDWITH ENDPROC PROCEDURE Grid1.Show This.Visible = .T. ENDPROC PROCEDURE Grid1.Hide This.Visible = .F. 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 DEFINE CLASS C_Header AS Header FontName = "微软雅黑" FontSize = 10 BackColor = RGB(128,128,128) ForeColor = RGB(255,255,255) WordWrap = .T. Alignment = 2 PROCEDURE MouseEnter(tnButton, tnShift, tnXCoord, tnYCoord) This.ForeColor = RGB(0,255,255) ENDPROC PROCEDURE MouseLeave(tnButton, tnShift, tnXCoord, tnYCoord) This.ForeColor = RGB(255,255,255) ENDPROC ENDDEFINE