************************************************** *-- Class: expandedit (c:\temp\test.vcx) *-- ParentClass: editbox *-- BaseClass: editbox *-- one line expanding edit box * DEFINE CLASS expandedit AS editbox Height = 25 Width = 145 Name = "expandedit" *-- original height when got focus PROTECTED orgheight *-- original width when got focus PROTECTED orgwidth *-- Expanded height of editbox PROTECTED expandedheight *-- Expanded width of editbox PROTECTED expandedwidth nrec = .F. PROCEDURE Init with this .orgheight = .height .orgwidth = .width do case case .parent.baseclass="Page" && We are in a pageframe .ExpandedHeight = .parent.parent.pageheight - .top - 4 .ExpandedWidth = .parent.parent.pagewidth - .left - 4 case .parent.baseclass="Column" && We are in a grid .ExpandedHeight = .parent.parent.height - .parent.parent.headerheight ; - iif(.parent.parent.scrollbars%2=1,sysmetric(8),0) .ExpandedWidth = .parent.parent.width .orgheight = .parent.parent.rowheight .orgwidth = .parent.width .BorderStyle = 0 otherwise .ExpandedHeight = .parent.height - .top - 4 .ExpandedWidth = .parent.width - .left - 4 endcase endwith ENDPROC PROCEDURE GotFocus WITH this thisform.lockscreen = .t. IF ( !isnull(evaluate(.controlsource)) and ; !empty(evaluate(.controlsource)) ) or ; !.readonly if .parent.baseclass="Column" && We are in a grid .parent.parent.rowheight = .ExpandedHeight .parent.width = .ExpandedWidth else .height = .ExpandedHeight .width = .ExpandedWidth endif .refresh ENDIF .zorder(0) thisform.lockscreen = .f. ENDWITH ENDPROC PROCEDURE LostFocus with this if .parent.baseclass="Column" && We are in a grid .parent.parent.rowheight = .OrgHeight .parent.width = .OrgWidth else .height = .orgheight .width = .orgwidth endif .refresh endwith ENDPROC PROCEDURE RightClick keyboard "{TAB}" ENDPROC ENDDEFINE * *-- EndDefine: expandedit **************************************************Cetin