MouseEnter and MouseLeave Events
-
I'm new to C++ and am running into another hicucp I'm hoping someone can help me with. I'm looking to change the opacity on a form when the mouse enters it (to 100%), and then dim it again when the mouse leaves the Windows form. I can almost get things to work, but I'm seeing oddities that I think are due to the fact that it "enters" other controls that are on the form. Here's what I've been tinkering around with:
private: System::Void MyForm_MouseHover(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 1.00;
}private: System::Void MyForm_MouseLeave(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 0.50;
}private: System::Void MyForm_MouseEnter(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 1.00;
}Can someone explain to me how I can prevent my code from repeatedly reading things until the cursor leaves the entire form? Thanks!