I was wondering how I would make an image appear inside a messagebox that I set up so that whenever the mouse enters a label, it displays the messagebox. What would the code be for the image insertion?
Quick and dirty way to achieve this is to create another windows form that will have same buttons as message box but that will also have an image.
Here is a code behind for this form
public partial class MazeForm : Form
{
public MazeForm()
{
InitializeComponent();
}
private bool okButton = false;
public bool OKButtonClicked
{
get { return okButton; }
}
private void btnOK_Click(object sender, EventArgs e)
{
okButton = true;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
okButton = false;
this.Close();
}
}
Finally in your main form you can do something like this
MazeForm m = new MazeForm();
m.ShowDialog();
bool okButtonClicked = m.OKButtonClicked;
Note that this is something I quickly created in 15 min and that it probably needs more work but it will get you in the right direction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With