Thonord
Member
- Joined
- Oct 25, 2012
- Messages
- 23
- Programming Experience
- 10+
Or rather; control when it fires - or not - even if it wants to.
I have a PictureBox (Pb) on a panel on a form, loaded with an image, much larger than the Pb. (the reason for the panel is cuz it gives auto scrollbars).
90% of operation is done with the mouse over the Pb. I'm using move, down, up, left, right etc. etc. and I'm trapping form.keypress to draw stuff on the Pb. All works OK.
But - because I use keypress, I have to keep track of witch form control that has focus. I don't want text to appear in a random TextBox, and CRLF creates a lot of fun
To solve this, I set focus to the Pb when mousy enters the Pb, and focus to the "most probable" TextBox when I leave. Also works fine, But both focus-changes cause paint events.
Since the image is much larger than the Pb, if I "move" the image with the panel scrollbars, and then cross the boundary of the Pb, the image resets to the default position because of the paint event. (0,0 at Top,Left)
I really need to be able to move the mouse in and out of the Pb without the scrolled image resetting!
What I'm looking for is
If I don't want you to fire Then
qqqqqDon't fire
Else
qqqqqDo
Endif
I have a PictureBox (Pb) on a panel on a form, loaded with an image, much larger than the Pb. (the reason for the panel is cuz it gives auto scrollbars).
90% of operation is done with the mouse over the Pb. I'm using move, down, up, left, right etc. etc. and I'm trapping form.keypress to draw stuff on the Pb. All works OK.
But - because I use keypress, I have to keep track of witch form control that has focus. I don't want text to appear in a random TextBox, and CRLF creates a lot of fun
To solve this, I set focus to the Pb when mousy enters the Pb, and focus to the "most probable" TextBox when I leave. Also works fine, But both focus-changes cause paint events.
Since the image is much larger than the Pb, if I "move" the image with the panel scrollbars, and then cross the boundary of the Pb, the image resets to the default position because of the paint event. (0,0 at Top,Left)
I really need to be able to move the mouse in and out of the Pb without the scrolled image resetting!
What I'm looking for is
If I don't want you to fire Then
qqqqqDon't fire
Else
qqqqqDo
Endif