编码:
void btnSettings_Click(object obj, EventArgs args)
{
frmSettings dialogSettings = new frmSettings();
dialogSettings.Modal = true;
dialogSettings.TransientFor = this;
dialogSettings.Parent = this;
dialogSettings.ParentWindow = this.GdkWindow;
dialogSettings.SetPosition(Gtk.WindowPosition.CenterOnParent);
dialogSettings.Show();
}
我尝试了 TransientFor、Parent、ParentWindow 属性,但它们都没有强制我的对话框显示在父(调用者)窗口的中心。想法?谢谢你。