By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,946 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,946 IT Pros & Developers. It's quick & easy.

Open File Dialog and Picturebox Click Event

P: n/a
Hello,
Not sure if anyone else has seen this bug, but I have a form where
the entire form is covered with a picturebox. The picturebox has a
mouseup event. I also have an open file dialog for loading images into
the picturebox. If you double click the file you want to open in the
open file dialog, it somehow interperets one of the clicks as a mouseup
on the picturebox and fires the mouseup event for the picturebox. How
can I get around this? I tried disabling the picturebox before loading
the dialog and enabling it after I complete loading the file, but it
still fires the mouseup event.

Any thoughts would be a big help!

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi I can repoduce the same behavior, but do you open your open file dialog
from the click event of your picturebox? If that's the case it's expected
behavior for the mouseup to fire after the open file dialog is closed.
Because you click the picturebox hence the click event gets raised but
whenever you click on the picturebox there's also a mousedown and a mouseup
to be fired and if you than handle the mouse up it's normal behavior for the
mouseup to be fired after the click event is processed even if you open an
open file dialog in the click event.

Hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Mattbooty" <ma*******@mattbooty.com> schreef in bericht
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello,
Not sure if anyone else has seen this bug, but I have a form where
the entire form is covered with a picturebox. The picturebox has a
mouseup event. I also have an open file dialog for loading images into
the picturebox. If you double click the file you want to open in the
open file dialog, it somehow interperets one of the clicks as a mouseup
on the picturebox and fires the mouseup event for the picturebox. How
can I get around this? I tried disabling the picturebox before loading
the dialog and enabling it after I complete loading the file, but it
still fires the mouseup event.

Any thoughts would be a big help!

Nov 21 '05 #2

P: n/a
No, I'm opening the open file dialog from a menu item. And it doesn't
fire the mouseup when I click the file I want then click "open" button,
only when I double click the file. I believe the open file is
interpereting a double click as a mousedown mouseup mousedown (i.e. a
single click plus another mousedown) so there is a mouseup remaining
after double clicking the file.

Peter Proost wrote:
Hi I can repoduce the same behavior, but do you open your open file dialog
from the click event of your picturebox? If that's the case it's expected
behavior for the mouseup to fire after the open file dialog is closed.
Because you click the picturebox hence the click event gets raised but
whenever you click on the picturebox there's also a mousedown and a mouseup
to be fired and if you than handle the mouse up it's normal behavior for the
mouseup to be fired after the click event is processed even if you open an
open file dialog in the click event.

Hth

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Mattbooty" <ma*******@mattbooty.com> schreef in bericht
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello,
Not sure if anyone else has seen this bug, but I have a form where
the entire form is covered with a picturebox. The picturebox has a
mouseup event. I also have an open file dialog for loading images into
the picturebox. If you double click the file you want to open in the
open file dialog, it somehow interperets one of the clicks as a mouseup
on the picturebox and fires the mouseup event for the picturebox. How
can I get around this? I tried disabling the picturebox before loading
the dialog and enabling it after I complete loading the file, but it
still fires the mouseup event.

Any thoughts would be a big help!


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.