FontDialog类继承自CommonDialog,没有Location及Size属性,其他自CommonDialog派生的类,如ColorDialog、FileDialog等也是如此。
API函数GetWindowRect、SetWindowPos可以获取和设置窗体的位置和大小。
1
using System;
2
using System.Drawing;
3
using System.Windows.Forms;
4
using System.Runtime.InteropServices;
5
6
class FontDialog : System.Windows.Forms.FontDialog
7
2
3
4
5
6
7