tailieunhanh - Programming Microsoft Windows with C# phần 7

Visual Studio NET 2003 bao gồm một trang pageLayout bất động sản, cho phép định vị chính xác của điều khiển máy chủ, khi tài sản pageLayout được thiết lập để GridLayout. Visual Studio và và sau đó không có một tài sản pageLayout trên các tài liệu mẫu web, nhưng có một khả năng tương tự như trong các thiết kế HTML. | public DialogsWithRegistryO Text Font and Color Dialogs with Registry RegistryKey regkey strRegKey if regkey null Font new Font string strFontFace string strFontSize Fontstyle strFontStyle ForeColor int strForeColor BackColor int strBackColor int aiColors new intfis for int i 0 i IS i aiColorsfi int strCustomClr i aiColors protected override void OnClosed EventArgs ea RegistryKey regkey strRegKey true if regkey null regkey strRegKey strFontFace strFontSize strFontStyle int strForeColor strBackColor for int i 0 i IS i strCustomClr i Let s look at the override of the OnClosed method first. OnClosed is called when the form has been closed. That s a good time for the program to write information to the registry. If the OpenSubKey call returns null the program must be running for the first time so it calls CreateSubKey to create the registry key. Each Setvalue call stores either an integer or a string in the registry. For the form s Font property three values must be stored the Name SizelnPoints and Style properties. The SizelnPoints property of Font is a float so that value is converted to a string representation with ToString. The ToArgb method of the Color class converts Color objects into integers. Also take note of the Setvalue call in the for loop that s used to store the custom colors. The value name is strCustomClr i which creates names of CustomColorO CustomColorl through CustomColor15. The values are loaded from the registry in the program s constructor. The form s font is re-created

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.