怎样为userform中的image动态定义鼠标点击事件
题目可能说得不清楚,我要实现如下功能:
在一个Userform中,显示某个目录下的所有图片(用Image控件),鼠标点击某个图片,可以获得该图片的文件名。
我的做法是:
Dim theImageBox As Image
Set theImageBox = thePage.Controls.Add("Forms.Image.1", "image", True)
theImageBox.Move X, Y, picWidth, picHeight
theImageBox.Picture = LoadPicture(fullFileName)
问题是我无法定义每个Image的鼠标点击事件。
请各位不吝赐教,我只要实现所述功能,不一定要用Image控件。