
Custom Buttons on GTPUMessageBox

ycasas
✭
Hello all,
I would like to show a message box containing buttons with custom text (not OK, Cancel, Yes, No). This is possible with some of the overloaded methods of GTPUMessageBox.Show, but I don't know how to handle the click event of the custom buttons.
Can anyone show me how to do it? Some code snippets, maybe?
Thank you,
Yolanda Casas
0
Comments
-
Hello again,
Finally I found the way to make it work... I will post some sample code in case it can be of use to anyone else:
GTPUMessageBox.Show(this, new MessageBoxEventHandler(HandleSelectionResult), "Please chose A or B:", "Select option", ABB.Robotics.Tps.Drawing.TpsIcon.Info, new string[] {"A", "B"});
void HandleSelectionResult(object sender, MessageBoxEventArgs e)
{
if (e.ButtonText.Trim().CompareTo("A") == 0)
{
// Do stuff corresponding to A
}
else if (e.ButtonText.Trim().CompareTo("B") == 0)
{
// Do stuff corresponding to B
}
}
*Note the "Trim()" operation on e.ButtonText before the comparation!!
Regards,Yolanda Casas0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings