FontDialog类继承自CommonDialog,没有Location及Size属性,其他自CommonDialog派生的类,如ColorDialog、FileDialog等也是如此。
 

继承层次结构

System.Object
    System.MarshalByRefObject
        System.ComponentModel.Component
            System.Windows.Forms.CommonDialog
                System.Windows.Forms.ColorDialog
                System.Windows.Forms.FileDialog
                System.Windows.Forms.FolderBrowserDialog
                System.Windows.Forms.FontDialog
                System.Windows.Forms.PageSetupDialog
                System.Windows.Forms.PrintDialog

 
 
API函数GetWindowRect、SetWindowPos可以获取和设置窗体的位置和大小。
 
 1为System.Windows.Forms.FontDialog类添加Location属性using System;
 2为System.Windows.Forms.FontDialog类添加Location属性using System.Drawing;
 3为System.Windows.Forms.FontDialog类添加Location属性using System.Windows.Forms;
 4为System.Windows.Forms.FontDialog类添加Location属性using System.Runtime.InteropServices;
 5为System.Windows.Forms.FontDialog类添加Location属性
 6为System.Windows.Forms.FontDialog类添加Location属性class FontDialog : System.Windows.Forms.FontDialog
 7

相关文章: