Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
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 toControl.AddProperty nOriginalTop toControl.Top ENDIF IF PEMSTATUS toControl Left 5 toControl.AddProperty nOriginalLeft toControl.Left ENDIF IF PEMSTATUS toControl Fontsize 5 toControl.AddProperty nOriginalFontSize toControl.FontSize 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 toControl.BaseClass PAGEFRAME FOR EACH loPage IN toControl.Pages This.SaveOriginalDimensions loPage ENDFOR CASE INLIST UPPER toControl.BaseClass PAGE CONTAINER FOR EACH loControl IN toControl.Controls This.SaveOriginalDimensions loControl ENDFOR CASE INLIST UPPER ALLTRIM toControl.BaseClass COMMANDGROUP OPTIONGROUP LOCAL lnButton FOR lnButton 1 TO toControl.ButtonCount This.SaveOriginalDimensions toControl.Buttons 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 toControl.BaseClass 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 toControl.BaseClass COMBOBOX LISTBOX WITH toControl .AddProperty nOriginalColumnWidths .ColumnWidths ENDWITH OTHERWISE There is no otherwise.I 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 Thisform.cusResizer.AdjustControls The custom AdjustControls .