tailieunhanh - 1001 Things You Wanted To Know About Visual FoxPro phần 9

Tham khảo tài liệu '1001 things you wanted to know about visual foxpro phần 9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 11 Forms and Other Visual Classes 369 nOriginalTop ENDIF IF PEMSTATUS toControl Left 5 nOriginalLeft ENDIF IF PEMSTATUS toControl Fontsize 5 nOriginalFontSize ENDIF Next we check to see if the current object is a container. If it is and it contains other objects we will have to pass them to this method recursively DO CASE CASE UPPER PAGEFRAME FOR EACH loPage IN loPage ENDFOR CASE INLIST UPPER PAGE CONTAINER FOR EACH loControl IN loControl ENDFOR CASE INLIST UPPER ALLTRIM COMMANDGROUP OPTIONGROUP LOCAL lnButton FOR lnButton 1 TO lnButton ENDFOR We can also handle the special cases here. For example grids have RowHeight and HeaderHeight properties that need to be saved and we need to save the original widths of all of its contained columns. Combo and List boxes also require special handling to save the original ColumnWidths CASE UPPER GRID WITH toControl .AddProperty nOriginalRowHeight .RowHeight .AddProperty nOriginalHeaderHeight .HeaderHeight .AddProperty nOriginalColumnWidths 1 DIMENSION .nOriginalColumnWidths .ColumnCount FOR lnCol 1 TO .ColumnCount .nOriginalColumnWidths lnCol .Columns lnCol .Width ENDFOR ENDWITH CASE INLIST UPPER COMBOBOX LISTBOX WITH toControl .AddProperty nOriginalColumnWidths .ColumnWidths ENDWITH OTHERWISE There is no think we got all cases ENDCASE 370 1001 Things You Always Wanted to Know About Visual FoxPro Having saved all the original values we need to ensure that the resizer is invoked whenever the form is resized. A single line of code in the form s Resize method is all that is needed The custom AdjustControls .