Groups | Search | Server Info | Login | Register
Groups > comp.databases.ms-access > #810
| From | "Phil" <phil@stantonfamily.co.uk> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: Getting control names by passing the mouse over them. |
| Date | 2011-04-04 23:07 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <indfed$dmo$1@speranza.aioe.org> (permalink) |
| References | <inaso6$2ah$1@speranza.aioe.org> <Ww8mp.2908$Pi.167@newsfe22.ams2> |
On 04/04/2011 01:45:41, "Stuart McCall" wrote: > "Phil" <phil@stantonfamily.co.uk> wrote in message > news:inaso6$2ah$1@speranza.aioe.org... >>I have a number of controls in the detail section of a form, each control >> corresponding to an individual record in a table (Spaces). The controls >> are >> all named something like "Space001", "Space002" ... "Space120". Got bored >> after that There is a field in the table called "Selected". >> When a drag the mouse over any number of controls, I want to change >> Selected >> to true if it is false, and vice-versa. >> >> >> Problem appears to be that as I drag the mouse over a single control, the >> MouseMove keep "firing". How do I "switch it off" until I hit the next >> control? Thanks >> Phil > > Use a static variable to see if the control has changed since the last > mouse move notification: > > Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As > Single, Y As Single) > > Static CtlName As String > Dim Ctl As Control > > If Button And acRightButton Then > For Each Ctl In Me.Section(acDetail).Controls > If X >= Ctl.left And X <= Ctl.left + Ctl.Width Then > If Y >= Ctl.top And Y <= Ctl.top + Ctl.Height Then > If Ctl.Name <> CtlName Then > Call SaveSelect(CInt(right(Ctl.Name, 3))) > CtlName = Ctl.Name > End If > End If > End If > Next Ctl > End If > > End Sub > Thanks Stuart. That bit works perfectly Still having problems if the images are overlapping (or completely covering each other). All my images are transparent, so I can see the image indeneath, but not neccessarily be able to pick it up. Will do some more research ans come back Thanks again Phil
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Find similar
Getting control names by passing the mouse over them. "Phil" <phil@stantonfamily.co.uk> - 2011-04-03 23:35 +0100
Re: Getting control names by passing the mouse over them. "Stuart McCall" <smccall@myunrealbox.com> - 2011-04-04 01:45 +0100
Re: Getting control names by passing the mouse over them. "Phil" <phil@stantonfamily.co.uk> - 2011-04-04 23:07 +0100
csiph-web