2012-05-09 9 views

答えて

9

あなたはNSAlertを探しています。これはMessageBoxとほぼ同じです。

NSAlert.RunModal()を使用してNSAlertを表示したり、特定のウィンドウにシートとして表示したい場合はNSAlert.BeginSheet()を使用できます。

var alert = new NSAlert { 
    MessageText = "Hello, this is an alert!", 
    AlertStyle = NSAlertStyle.Informational 
}; 

alert.AddButton ("OK"); 
alert.AddButton ("Cancel"); 

var returnValue = alert.RunModal(); 
// returnValue will be 1000 for OK, 1001 for Cancel 

あなたはここにMonoMacの観点から、もう少しそれを使用する方法を見てとることができます。

https://github.com/picoe/Eto/blob/master/Source/Eto.Platform.Mac/Forms/MessageBoxHandler.cs

関連する問題