473,441 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

Change borderstyle on mouse hover

glb is a global string, I want when moving mouse to a picturebox, change
border style of picturebox.
the code shown below do that but MouseLeave event fires less than a second
after MouseHover,
even without leaving the mouse pointer or moving that.
I also tried MouseEnter event instead of MouseHover, but they act same here.
Private Sub p1_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter, p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

sender.BorderStyle = BorderStyle.FixedSingle
glb = sender.Name

End Sub
Private Sub p1_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter, p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

If glb = sender.Name Then sender.BorderStyle = BorderStyle.None

End Sub
Nov 23 '05 #1
2 2816
In your code below, p1_MouseHover and p1_MouseLeave both handles the
exact same events. Unless this is a typo in your post I'd say this is the
problem

/claes

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:eM**************@TK2MSFTNGP14.phx.gbl...
glb is a global string, I want when moving mouse to a picturebox, change
border style of picturebox.
the code shown below do that but MouseLeave event fires less than a second
after MouseHover,
even without leaving the mouse pointer or moving that.
I also tried MouseEnter event instead of MouseHover, but they act same here.

Private Sub p1_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter, p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

sender.BorderStyle = BorderStyle.FixedSingle
glb = sender.Name

End Sub
Private Sub p1_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter, p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

If glb = sender.Name Then sender.BorderStyle = BorderStyle.None

End Sub

Nov 23 '05 #2
Thanks, I've been sleepy and didn't notice that!

"Claes Bergefall" <cl*************@nospam.com> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl...
In your code below, p1_MouseHover and p1_MouseLeave both handles the
exact same events. Unless this is a typo in your post I'd say this is the
problem

/claes

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:eM**************@TK2MSFTNGP14.phx.gbl...
glb is a global string, I want when moving mouse to a picturebox, change
border style of picturebox.
the code shown below do that but MouseLeave event fires less than a
second
after MouseHover,
even without leaving the mouse pointer or moving that.
I also tried MouseEnter event instead of MouseHover, but they act same

here.


Private Sub p1_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter,
p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

sender.BorderStyle = BorderStyle.FixedSingle
glb = sender.Name

End Sub
Private Sub p1_MouseLeave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles p1.MouseLeave, p2.MouseEnter, p3.MouseEnter,
p4.MouseEnter, p5.MouseEnter, p6.MouseEnter, p7.MouseEnter,
p8.MouseEnter,
p9.MouseEnter, p10.MouseEnter, p11.MouseEnter, p12.MouseEnter

If glb = sender.Name Then sender.BorderStyle = BorderStyle.None

End Sub


Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephen Williams | last post by:
I am migrating a VB 6 PictureBox control to VB.NET. In VB 6, this control modified its border style during the mouse down and up events to provide user feedback that it was selected. Once...
12
by: jfburr | last post by:
very simple thing (I hope) I've got a css style sheet that starts like this: ______________ A:link { color: cc9933; }
1
by: nick | last post by:
I have the following code: <style> #item1 { DISPLAY: block; BACKGROUND: url(ProjMenuImgs/ProjBtn.gif) no-repeat 0px 0px; WIDTH: 87px; HEIGHT: 94px; } #item1:hover { background-position: 0...
11
by: Yeah | last post by:
I have a multiple choice quiz where I would like to use CSS to change the color of the answers upon clicking them. I would like to present the right and wrong answers up front, rather than direct...
5
by: BrianW | last post by:
I am working on a program that has multiple picturebox controls that a user is allowed to move around which are contained within a panel control for visual placement. In my mousedown event, I set...
15
by: Mike | last post by:
I'm trying to modify actual html content via the style sheet. I know there is the :before and :after tags, but I'm not quite sure how to use it and if there's another way to do it. Here's the...
2
by: spifster | last post by:
Hello all, I am building a collapsable tree using Javascript with DOM in IE. In order to make collapsed cells disappear I have been hiding the text. The cells collapse but still leave borders...
2
by: fredd00 | last post by:
how can i change the back color on mouse out to the color specified in the grid view declaration in the gridview declaration <AlternatingRowStyle BackColor="#CECECE" /> <RowStyle...
5
by: studentofknowledge | last post by:
hi guys im new to javascript and need some guidence please.. im trying to display a 400x400 pixel coloured area in the middle of a webpage that stays in the middle with a browser window resize....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.