我正在使用或'学习'C++/CLI,因为我喜欢GUI的外观,而且我试图在鼠标移到图片上时触发某些事件,图片,但它不起作用,并且唯一的事件是当鼠标点击图片时。点击事件处理程序没有被调用
我的代码是向下跌破
void pictureBox1_MouseEnter(Object^ sender, System::Windows::Forms::MouseEventArgs^) {
label1->Text = String::Concat(sender->GetType(), ": Enter");
}
void pictureBox1_MouseHover(Object^ sender, System::Windows::Forms::MouseEventArgs^) {
label1->Text = String::Concat(sender->GetType(), ": MouseHover");
}
void pictureBox1_MouseLeave(Object^ sender, System::Windows::Forms::MouseEventArgs^) {
label1->Text = String::Concat(sender->GetType(), ": MouseLeave");
}
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
label1->Text = String::Concat(sender->GetType(), ": Click");
}
“不行”是什么意思?你的意思是它永远不会被调用,或者它不符合你的期望? – 2013-03-26 16:44:41
是的,它从来没有被称为和dosent做任何事情 – 2013-03-26 16:45:17
C#是非常类似的struktur所以也许有人会现在awnser – 2013-03-26 16:48:52