Hello!
I have a UserControl that have two other controls inside it. I need to set a
different border color for my UserControl when the mouse enters it, and
restore the border color when the mouse leaves it.
The problem is, when the mouse passes in a contained control, the
UserControl raises a MouseLeave and the border is restored back, although
the mouse, for the customer, is yet inside the UserControl.
It's possible I do the UserControl ignores all mouse events for his
contained controls? Or there is another approach?
Cesar 4 2011
Add the child control to your handles as well.
For instance if you have a panel named Panel1 with a label named Label1
contained in it you can use:
Private Sub Panel1_MouseEnt er(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Panel1.MouseEnt er, _
Label1.MouseEnt er
Panel1.BackColo r = Color.Black
End Sub
Then do the same thing for the mouseleave event
"ronchese" <info(a)carsoft net.com.br> wrote in message
news:e5******** ******@TK2MSFTN GP02.phx.gbl... Hello!
I have a UserControl that have two other controls inside it. I need to set a different border color for my UserControl when the mouse enters it, and restore the border color when the mouse leaves it.
The problem is, when the mouse passes in a contained control, the UserControl raises a MouseLeave and the border is restored back, although the mouse, for the customer, is yet inside the UserControl.
It's possible I do the UserControl ignores all mouse events for his contained controls? Or there is another approach?
Cesar
Yeah, I did that already.
But that makes me paint the control everytime a contained control get the
focus, once the control is already painted with that status, because the
mouse is already inside it.
I was trying to get a way to ensure that border is painted just one time per
MouseEnter and just one time per MouseLeave. It can be performatic when
eventually I start painting hard drawings on there.
But thanks anyways, for the response.
Cesar
"Jason" <js******@comca st.net> wrote in message
news:G9******** ************@co mcast.com... Add the child control to your handles as well.
For instance if you have a panel named Panel1 with a label named Label1 contained in it you can use: Private Sub Panel1_MouseEnt er(ByVal sender As Object, ByVal e As System.EventArg s) Handles Panel1.MouseEnt er, _
Label1.MouseEnt er
Panel1.BackColo r = Color.Black
End Sub
Then do the same thing for the mouseleave event "ronchese" <info(a)carsoft net.com.br> wrote in message news:e5******** ******@TK2MSFTN GP02.phx.gbl... Hello!
I have a UserControl that have two other controls inside it. I need to set a different border color for my UserControl when the mouse enters it, and restore the border color when the mouse leaves it.
The problem is, when the mouse passes in a contained control, the UserControl raises a MouseLeave and the border is restored back, although the mouse, for the customer, is yet inside the UserControl.
It's possible I do the UserControl ignores all mouse events for his contained controls? Or there is another approach?
Cesar
What kind of controls are they? Can you set the enabled property of the
child controls to False? If so, this should keep it from triggering event.
"ronchese" <info(a)carsoft net.com.br> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. .. Yeah, I did that already.
But that makes me paint the control everytime a contained control get the focus, once the control is already painted with that status, because the mouse is already inside it.
I was trying to get a way to ensure that border is painted just one time per MouseEnter and just one time per MouseLeave. It can be performatic when eventually I start painting hard drawings on there.
But thanks anyways, for the response.
Cesar
"Jason" <js******@comca st.net> wrote in message news:G9******** ************@co mcast.com... Add the child control to your handles as well.
For instance if you have a panel named Panel1 with a label named Label1 contained in it you can use: Private Sub Panel1_MouseEnt er(ByVal sender As Object, ByVal e As System.EventArg s) Handles Panel1.MouseEnt er, _
Label1.MouseEnt er
Panel1.BackColo r = Color.Black
End Sub
Then do the same thing for the mouseleave event "ronchese" <info(a)carsoft net.com.br> wrote in message news:e5******** ******@TK2MSFTN GP02.phx.gbl... Hello!
I have a UserControl that have two other controls inside it. I need to set a different border color for my UserControl when the mouse enters it, and restore the border color when the mouse leaves it.
The problem is, when the mouse passes in a contained control, the UserControl raises a MouseLeave and the border is restored back, although the mouse, for the customer, is yet inside the UserControl.
It's possible I do the UserControl ignores all mouse events for his contained controls? Or there is another approach?
Cesar
I use some labels. On disabling it, is turning the texts disabled, too.
"Jason" <js******@comca st.net> wrote in message
news:QJ******** ************@co mcast.com... What kind of controls are they? Can you set the enabled property of the child controls to False? If so, this should keep it from triggering event.
"ronchese" <info(a)carsoft net.com.br> wrote in message news:%2******** ********@TK2MSF TNGP03.phx.gbl. .. Yeah, I did that already.
But that makes me paint the control everytime a contained control get the focus, once the control is already painted with that status, because the mouse is already inside it.
I was trying to get a way to ensure that border is painted just one time per MouseEnter and just one time per MouseLeave. It can be performatic when eventually I start painting hard drawings on there.
But thanks anyways, for the response.
Cesar
"Jason" <js******@comca st.net> wrote in message news:G9******** ************@co mcast.com... Add the child control to your handles as well.
For instance if you have a panel named Panel1 with a label named Label1 contained in it you can use: Private Sub Panel1_MouseEnt er(ByVal sender As Object, ByVal e As System.EventArg s) Handles Panel1.MouseEnt er, _
Label1.MouseEnt er
Panel1.BackColo r = Color.Black
End Sub
Then do the same thing for the mouseleave event "ronchese" <info(a)carsoft net.com.br> wrote in message news:e5******** ******@TK2MSFTN GP02.phx.gbl... Hello!
I have a UserControl that have two other controls inside it. I need to set a different border color for my UserControl when the mouse enters it, and restore the border color when the mouse leaves it.
The problem is, when the mouse passes in a contained control, the UserControl raises a MouseLeave and the border is restored back, although the mouse, for the customer, is yet inside the UserControl.
It's possible I do the UserControl ignores all mouse events for his contained controls? Or there is another approach?
Cesar
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: red |
last post by:
mouse events when the mouse is on a "child control"
hi everyone;
my problem:
I have a userControl
in this usercontrol, I have a child control (a button)
when the mouse moves over the userControl, I can detect the movement using
MouseMove event.
the problem is when the mouse is on the child control : I can t detect
|
by: Mike |
last post by:
Currently, when my application needs to write/read to a
database, there is a time lag. In that time lag, a user
can click the same button multiple times causing my app
problems. I want to turn the mouse pointer arrow into an
hourglass and ignore mouse clicks until my app finishes
working. Most commercial apps I've looked at do this.
Is there an easy way to do this (ie. any built-in
controls in VS.NET or classes in MSDN)? Any...
|
by: Anders Eriksson |
last post by:
Hello!
I have a program with three views
------------------------------------
| | |
| 1 | 2 |
| | |
| |--------------------------|
| | |
|
by: KarenP |
last post by:
In my Windows Forms application, while executing a process that takes some
time, I am changing the cursor to the hourglass by setting Cursor.Current =
Cursors.WaitCursor.
This is working just fine, except that any mouse events generated during
this wait period (such as clicking on a button, etc.), get processed once the
processing is complete. For example, while waiting for my task to complete,
I click on a button (even though the...
|
by: Lance |
last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI container form) or if the MDI child form's Visible property is set to False (after the MDI child form was shown). This is an enormous problem for my app because I must show different MDI child forms based on the state of my application and many of the...
| |
by: RobKinney1 |
last post by:
The subject line sounds a little funny, let me quickly explain:
I have created a custom control using ComboBox. But inside my class, I need
to know when the user does NOT click my control.
Of course, I can capture the event Click when someone clicks on the actual
control, but not when they click off of it.
Right now I am using the event handler myCustomControl.LostFocus, but that
requires someone to click on another button or text...
|
by: Rob |
last post by:
This is a curious problem. It seems like it should be quite easy. Of course
a timer is used to determine when form should be closed, but how do you
consistently reset the timer when the mouse is moved over the form.
Normally I would use the MouseMove event to know when the mouse moves over
the form and use that to reset the timer. However, this fails on a form that
has a large number of controls of the form. The Form.MouseMove event...
|
by: cefrancke |
last post by:
Is there a way to capture all relevant info about the mouse, without
using Mouse Up/Down etc. procedures?
I'm trying to make a custom function and send it the mouse info on
the
click event.
For example:
|
by: moonie |
last post by:
I have an msn style c# windows application with a form and panel on
it.
A news list is drawn from the database and dynamically added via
labels, link lables during form loading. In this application at run
time this list should be generated again as the filtering criteria
changes. So I clear the controls(labels) on the panel, get the list
from the database and generate the list again. The list is created
and
it works fine. But sometimes...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |