Re: Floating Box for Prices

Tech-Archive recommends: Fix windows errors by optimizing your registry




"Webbiz" <noreply@xxxxxxx> wrote in message
news:exG$EhcZIHA.5984@xxxxxxxxxxxxxxxxxxxxxxx

"Mike Williams" <mikea@xxxxxxxxxxxxxxxxx> wrote in message
news:uzoXs0YZIHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
"Webbiz" <noreply@xxxxxxx> wrote in message
news:uoNhZiVZIHA.4828@xxxxxxxxxxxxxxxxxxxxxxx

. . . Ooops! Forgot to add the example code to my last message . . .

Option Explicit

Private Sub Form_DblClick()
Unload Form2
Unload Me
End Sub

Private Sub Form_Load()
Me.WindowState = vbMaximized
Me.BackColor = vbCyan
Me.Show
Me.Print "Double Click to close"
Form2.Move 1000, 1000, 2000, 1000
Form2.BackColor = vbWhite
Form2.Show , Me
End Sub

Private Sub Form_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Form2.Move X + 1 * Screen.TwipsPerPixelX, _
Y + 1 * Screen.TwipsPerPixelY
End Sub

Mike


I see what you mean Mike. That was awful!

But suppose, as is the case with my application, that this box is ONLY
needed while the mouse is inside the PictureBox. Would the Hooks still be
the best way to go?

While the mouse is moving around the picture box, my existing .Mousemove
code detects the x,y to determine the price where the mouse is pointing.
This will be the information I need to transmit (send) to the floating
price box.

Thanks.

Webbiz

I applied the above code to my chart program. While it works that when I
click the mouse the box opens and moves with the mouse, and goes away when I
let the mouse button up, it also pops up when I double-click the picturebox.
And I am not talking about any slow double-clicks either.

When I do the double-click, my program is attempting to 'scroll' the chart,
which is my original code for double-clicking, and with this pop-up floating
price bar showing up also, the chart 'freezes'. When I close the program, my
IDE shuts down with some error that goes away too fast to read it. What I do
see, however, is the word "Object..." in the error dialog before it goes
away.

I believe the error is due to not properly removing the HOOK, since it never
gets to that code by the time I shut the frozen program down. My guess.

Meanwhile, changing the timer value from 100 to 200 does not change this
problem. It does, however, seem to be the length of delay I think works
best, as 100 is a bit quick. Anyway, it's not the problem.

Any suggestions?

Thanks.

Webbiz







.


Quantcast