GTPUmessage box display not as promised
Hello,
I use a GTPUMessageBox in my application, but it doesn't look as nice as i had hoped. My code is:
Inherits GTPUMasterDialog
GTPUMessageBox.Show(Me, Nothing, "message", "caption", Windows.Forms.MessageBoxIcon.Asterisk)
The problem is that both the caption and the icon aren't displayed. Can anyone tell me whats wrong?
Jan-Jaap
Comments
-
Try this snippet, which works for me:
GTPUMessageBox.Show(Me, _New MessageBoxEventHandler(AddressOf MBHandler), _
"Message here... ", _
"Dialog Title Here", _
System.Windows.Forms.MessageBoxIcon.Exclamation, _
System.Windows.Forms.MessageBoxButtons.OK)
Private Sub MBHandler(ByVal sender As System.Object, ByVal e As MessageBoxEventArgs)
' do nothing for now
End SubRussD38697,6285763889Russell Drown0 -
Hello Russ,
I tried your suggestion, but it doesn't make much of a difference: no icon, no caption. Does anyone have any ideas?
Regards,
Jan-Jaap0 -
When do you show this dialog? If you show it when you get a controller event you must use the Invoke method, otherwise you will get strange UI phenomenas. Urban38700,478599537Urban Vikblom
CONTAB0 -
The messagebox is shown in a click event from a button, as a confirmation of the click to the user.
Regards,
Jan-Jaap0 -
What version of RW and FPSDK are you using?
Have you tried every possible icon, and none of them are displayed?
Is the space where the dialog caption should be displayed shown? This should be a thin blue strip across the top of the MessageBox.
Does this behavior occur on both the physical GTPU and the Virtual IRC5, or only one of these?
RussD38700,6507986111Russell Drown0 -
Hello,
RW 158, SDK 5.06;
I tried several;
Where the caption should be, there is the blue line.
Both Virtual IRC5 as well as physical.
Regards,
Jan-Jaap0 -
Could you post a screenshot of the GTPUMessageBox you get from the VC, as well as the EXACT code that you used to display that GTPUMessageBox?Russell Drown0
-
Hello,
Here is the screenshot. The code is:
GTPUMessageBox.Show(Me, New MessageBoxEventHandler(AddressOf MBHandler), _
jan-jaap38700,7192939815
"Batch afgebroken. Huidige product wordt afgemaakt op beide stations", _
"Batch afgebroken", Windows.Forms.MessageBoxIcon.Asterisk)Regards,
Jan-Jaap0 -
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.
RussD38700,766412037Russell Drown0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings