If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Dialogresult for picturebox

Hi All,

the Button class is using, among other, the DialogResult Property, Which I use and it works great!
But...
know I whant to use DialogResult in combination with a PictureBox, which I use in severall cases as a button, to get rit of the
overload given by the button class.

I made a Custom Component PictureBox called "CPictureBox".

But know I have to implement the dialogresult into it.
How should this be done??

Re: Dialogresult for picturebox

You have a couple of issues with your code:

1) In form2, you aren't setting the dialogresult from each picture box back to the dialog result of Form2. If you had derived from a button instead of a picture box, this would be connected up automatically for you. No matter, just set them in the click handlers.

Re: Dialogresult for picturebox

hi Arjay,

Thanks for the reply!!

Now it is working like it should.
and so easy....

Now I want to go one step futher.
I want to make use of the TAB key, just like 'normal' buttons.

So I need OnLeave and OnEnter.
How can I place this in my CustomPictureBox. (need to derive from control I think)
and How do I fire them.
So let say if the 'button' has focus the Yes or No text will be underlined, something like that.