[ Snippet ] Epicor HandHeldMessageBox

Epicor Framework comes with a special helper method to display Message Boxes on the HandHeld UI properly within, it is the same size as the HandHeld UI and it can not be missed. You can use this Helper on any Form. It requires no dependencies.

hh1

HandHeldMessageBox.Show("Hello World");

hh2

HandHeldMessageBox.Show("Error, please try again!", MessageBoxButtons.OK, MessageBoxIcon.Error);

hh3

HandHeldMessageBox.Show("Error, please try again!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

hh4

DialogResult r = HandHeldMessageBox.Show("Would you like to dance?", MessageBoxButtons.YesNo);

if (r == DialogResult.Yes) {
  // Lets Dance
}

hh5

HandHeldMessageBox.Show("The Package has been delivered.", MessageBoxButtons.OK, MessageBoxIcon.Information);

Full Snippet

HandHeldMessageBox.Show("Hello World");
HandHeldMessageBox.Show("Error, please try again!", MessageBoxButtons.OK, MessageBoxIcon.Error);
HandHeldMessageBox.Show("Error, please try again!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
DialogResult r = HandHeldMessageBox.Show("Would you like to dance?", MessageBoxButtons.YesNo);
HandHeldMessageBox.Show("The Package has been delivered.", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
/*
MessageBoxButtons.OK
MessageBoxButtons.OKCancel
MessageBoxButtons.AbortRetryIgnore
MessageBoxButtons.YesNoCancel
MessageBoxButtons.YesNo
MessageBoxButtons.RetryCancel
 
MessageBoxIcon.Information
MessageBoxIcon.Error
MessageBoxIcon.Exclamation
MessageBoxIcon.Asterisk
MessageBoxIcon.None
*/
7 Likes

Rookie question here, but how would you go about overriding the height and size of said message box, is it possible?

Create your own dynamic form to display (dialog mode). Quick example ripped from MSDN:

Form frm = new Form();

frm.Text = "Dynamic form";

TextBox txt = new TextBox();

txt.Text = "Dynamic textbox name";

txt.Name = "txtName";

frm.Controls.Add(txt);

Button btn = new Button();

btn.Text = "Go to next form";

btn.Name = "btnNext";

btn.Click += new EventHandler(btnNext_Click);

btn.Location = new System.Drawing.Point(200, 200);

frm.Controls.Add(btn);

frm.ShowDialog();

Thanks Chris,
I was really grasping at the fact that HandheldMessageBox is used in some of the key dialogs like logout. I’ve resized our menu to be 380 high, and was wanting the logout to behave like it does in standard size (i.e. hides the menu), so unless I’m totally missing your point. Totally happy to be told different.