- Home /
Question by
boris200311 · Jan 29, 2020 at 02:37 AM ·
windowsmessagebox
How to use Windows icon on a messagebox
I want to use a pop-up messagebox with a Windows icon(ex. ), so I use the function "System.Windows.Forms.MessageBox.Show()".
However, it doesn't show a Windows icon but a icon that I have never seen before.
Is there anyway to change the icon back to the system's one?
Unity version: 2019.2.19f1 Project API compatibility level: .NET 4.x My code:
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
System.Windows.Forms.Application.EnableVisualStyles();
MessageBox.Show("Hello!","Title",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning);
UnityEngine.Application.Quit();
}
// Update is called once per frame
void Update()
{
}
}
擷取.png
(8.8 kB)
Comment