messagebox 这样的操作

(
  -- setup dotnet classes / objects
  local mb = dotNetClass "System.Windows.Forms.MessageBox"
  local buttons = dotNetClass "System.Windows.Forms.MessageBoxButtons"
  local icons = dotNetClass "System.Windows.Forms.MessageBoxIcon"
  local defaultButton = dotNetClass "System.Windows.Forms.MessageBoxDefaultButton"
  local dialogResult = dotNetClass "System.Windows.Forms.DialogResult"
  
  local result = mb.show "Do you want to save before quitting ?" "Quit" buttons.YesNoCancel icons.Information defaultButton.Button3
  
  -- evaluate result of messageBox (which button has been pressed by the user)
  if ( result == dialogResult.Yes ) then
  (
   format "YES\n"
  )
  else if ( result == dialogResult.No ) then
  (
   format "NO\n"
  )
  else if ( result == dialogResult.Cancel ) then
  (
   format "CANCEL\n"
  )
  
 )

你可能感兴趣的:(message)