Welcome Guest Search | Active Topics | Sign In | Register

Determining image button clicked in MsgBox Options
Jim Seaborg
Posted: Wednesday, April 4, 2012 2:59:46 PM
Rank: Member
Groups: Member

Joined: 8/21/2011
Posts: 13
Is there a away to determine which button is clicked in a MsgBox if the button types are images?

I'm able to create 2 "image type" MsgBoxButtons in a MsgBox, but I don't see how I can capture which one was clicked.

Thanks,

Jim
eo_support
Posted: Wednesday, April 4, 2012 3:28:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would use MsgBoxButton.CommandName to distinguish which button has been clicked inside your ButtonClick event handler.

Thanks!
Jim Seaborg
Posted: Wednesday, April 4, 2012 3:43:02 PM
Rank: Member
Groups: Member

Joined: 8/21/2011
Posts: 13

How would I go about passing which button was clicked (when I create the buttons)?
For the image type button, Im doin this:

MsgBox1.MsgBoxButtonType = MsgBoxButtonType.ImageButton
Dim buttonYes As MsgBoxButton = New MsgBoxButton("Images/Yes.gif")
Dim buttonNo As MsgBoxButton = New MsgBoxButton("Images/No.gif")
MsgBox1.Show("Confirmation", strContent, Nothing, buttonYes, buttonNo)

Thanks,

Jim
eo_support
Posted: Wednesday, April 4, 2012 3:48:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have already answered your question in our original reply ---- you would use MsgBoxButton.CommandName property. That is a property on the MsgBoxButton class. We are not in a position to show you how to work with a property on a class.

Thanks
Jim Seaborg
Posted: Wednesday, April 4, 2012 4:19:01 PM
Rank: Member
Groups: Member

Joined: 8/21/2011
Posts: 13
I think I didn't explain my challenge correctly.

When I use the following method to create a simple button, it works OK (I can use CommandName to detect the button that was clicked):

Dim buttonYes As MsgBoxButton = New EO.Web.MsgBoxButton("Yes", Nothing, "Yes")

But when I go to create an image button, your documented example says to use the following format:

Dim buttonYes As MsgBoxButton = New MsgBoxButton("Images/Yes.gif")

But this has only one value (not 3 like the first example). When I try to use your image button format,
there is no value for the CommandName to grab.

Thanks,
Jim
eo_support
Posted: Wednesday, April 4, 2012 4:31:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Jim,

I believe we understood your question correctly and have answered your question sufficiently. You have two extremely simple and almost identical lines of code with one working and the other one not working, yet you are asking us how to fix the one that's not working for you. We don't do this level of troubleshooting for our users. Please try to work out such coding issues yourself.

This issue is closed.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.