The problem you are seeing is that you are not supplying the correct number of parameters in your method call. There is no overloaded version that takes 5 parameters;the closest is
Show(ByVal owner As System.Windows.Forms.Control, ByVal callback As ABB.Robotics.Tps.Windows.Forms.MessageBoxEventHandler, ByVal text As String, ByVal ParamArray state() As Object)
This is the version you are actually, in effect, calling. Your 4th and 5th parameters are getting treated as the items in ParamArray, but they are not the expected values, so the dialog is formatted by ignoring what you are passing in for parameters 4 and 5. I am surprised that it doesn’t throw an exception because of this. The red “X” apparently is the default icon that is used when a valid value is not specified, and “OK” is the default button that is displayed.
The simplest thing you can do to fix this is to add a System.Windows.Forms.MessageBoxButtons argument, for instance System.Windows.Forms.MessageBoxButtons.OK, to the code snippet you supplied above. I have tested your code and confirmed that this will fix it, i.e. cause an icon to be displayed AND display the title caption. For example,
GTPUMessageBox.Show(Me, New MessageBoxEventHandler(AddressOf MBHandler), _
“Batch afgebroken. Huidige product wordt afgemaakt op beide stations”, _
“Batch afgebroken”, Windows.Forms.MessageBoxIcon.Asterisk, _ System.Windows.Forms.MessageBoxButtons.OK)
Note that you may find that some of the icons will not be displayed as expected. Here are the results I saw when testing each icon type with otherwise identical code.
System.Windows.Forms.MessageBoxIcon.Asterisk= the blue “i”
System.Windows.Forms.MessageBoxIcon.Exclamation= the yellow “!”
System.Windows.Forms.MessageBoxIcon.Hand= the red “X”
System.Windows.Forms.MessageBoxIcon.None= none
System.Windows.Forms.MessageBoxIcon.Question = the blue “i”
In reality, “Hand” is not a good name, it should probably be “Error” or something similar. “Question” is being mis-displayed, as its description in the object browser is “A question mark in a circle”. THis appears to be a defect.