MetroDialogBox.Show method doesn't exist

1.1k Views Asked by At

MetroFramework.Forms.MetroMessageBox does not have a Show() method. Using VS2017 Community, have installed MetroFramework with NuGet and referenced the Metro DLLs in my solution. have

using MetroFramework;
using MetroFramework.Forms;

in the Forms cs file. I am trying to do

MetroFramework.Forms.MetroMessageBox.Show(this, "Your message here.", "Title Here", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand);

but Show is illegal.

2

There are 2 best solutions below

0
mjwills On BEST ANSWER
MetroFramework.Forms.MetroMessageBox.Show(

should be either:

MetroFramework.MetroMessageBox(

or:

MetroMessageBox(

based on similar looking code at http://foxlearn.com/article/metro-message-box-in-csharp-124.html and the fact that MetroMessageBox is in the MetroFramework namespae.

0
Robert Murphy On

I had tried those. It seems the problem was I needed to get the package MetroModernUI rather than the MetroModern I had. I realised there were a bunch of controls eg DateTime, Trackbar that weren't in the Toolbox. Now have the proper Neget package and the MessageBox - including your code mjwills - now work.