Groups | Search | Server Info | Login | Register


Groups > comp.databases.ms-access > #810

Re: Getting control names by passing the mouse over them.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!aioe.org!.POSTED!not-for-mail
From "Phil" <phil@stantonfamily.co.uk>
Newsgroups comp.databases.ms-access
Subject Re: Getting control names by passing the mouse over them.
Date Mon, 4 Apr 2011 23:07:10 +0100
Organization Aioe.org NNTP Server
Lines 49
Message-ID <indfed$dmo$1@speranza.aioe.org> (permalink)
References <inaso6$2ah$1@speranza.aioe.org> <Ww8mp.2908$Pi.167@newsfe22.ams2>
NNTP-Posting-Host tzJWApdsynISXhvcCDnD1w.user.speranza.aioe.org
X-Complaints-To abuse@aioe.org
X-Antivirus-Status Clean
X-Notice Filtered by postfilter v. 0.8.2
X-Newsreader NewsMan Pro 3.0.4 (Freeware)
X-Antivirus avast! (VPS 110404-1, 04/04/2011), Outbound message
Xref x330-a1.tempe.blueboxinc.net comp.databases.ms-access:810

Show key headers only | View raw


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 | NextPrevious in thread | Find similar


Thread

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