<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hi Mike,<br>
<br>
Try running this code in a new Gambas Graphical Application
program: -<br>
<br>
<b>' Gambas class file</b><b><br>
</b><b><br>
</b><b>Label1 As Label</b><b><br>
</b><b><br>
</b><b>Public Sub Form_Open()</b><b><br>
</b><b><br>
</b><b> Dim PictureBox1 As PictureBox</b><b><br>
</b><b><br>
</b><b> With Me</b><b><br>
</b><b> .Arrangement = Arrange.Vertical</b><b><br>
</b><b> .Height = 150</b><b><br>
</b><b> .Width = 175</b><b><br>
</b><b> .Padding = 5</b><b><br>
</b><b> .Text = "Click!"</b><b><br>
</b><b> End With</b><b><br>
</b><b><br>
</b><b> With PictureBox1 = New PictureBox(Me) As "PictureBox1"</b><b><br>
</b><b> .Mode = PictureBox.Contain</b><b><br>
</b><b> .Alignment = Align.Center</b><b><br>
</b><b> .Expand = True</b><b><br>
</b><b> .Picture = Picture["icon:/huge/linux"]</b><b><br>
</b><b> End With</b><b><br>
</b><b><br>
</b><b> With Label1 = New Label(Me) As "Label1"</b><b><br>
</b><b> .Height = 28</b><b><br>
</b><b> .Text = "Click on the PictureBox"</b><b><br>
</b><b> .Alignment = Align.Center</b><b><br>
</b><b> .Font.Bold = True</b><b><br>
</b><b> End With</b><b><br>
</b><b><br>
</b><b>End</b><b><br>
</b><b><br>
</b><b>Public Sub PictureBox1_MouseDown()</b><b><br>
</b><b><br>
</b><b> If Mouse.Left Then Label1.Text = "You left clicked"</b><b><br>
</b><b> If Mouse.Right Then Label1.Text = "You right clicked"</b><b><br>
</b><b> If Mouse.Middle Then Label1.Text = "You middle clicked"</b><b><br>
</b><b><br>
</b><b>End</b><b><br>
</b><br>
I hope that helps,<br>
<br>
Charlie<br>
<br>
<br>
On 30/04/2020 10:45, Mike Crean via User wrote:<br>
</div>
<blockquote type="cite"
cite="mid:476431862.130750.1588239947635@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="ydp8b8e62c0yahoo-style-wrap" style="font-family:
Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;">
<div><span style="font-family: Helvetica, Arial, sans-serif;">Hi
all I am trying
to catch a mouse event when inside a PictureBox Child when
the LEFT</span></div>
<div><span style="font-family: Helvetica, Arial, sans-serif;">MOUSE
button is
pressed. I can’t for the life of me see the answer and it is
probably
staring</span></div>
<div><span style="font-family: Helvetica, Arial, sans-serif;">me
in the face.</span></div>
<div class="ydp8b8e62c0signature">
<div style="font-family:Helvetica, Arial,
sans-serif;font-size:13px;">
<div dir="ltr" data-setdir="false">
<div>
<p style="margin-bottom: 0cm; line-height: 100%"><br>
</p>
<p style="margin-bottom: 0cm; line-height: 100%">Public
Sub
Timer1_Timer()</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Dim oo As
PictureBox</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Dim I As Integer</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Dim x As Integer</p>
<p style="margin-bottom: 0cm; line-height: 100%"> I
= 0</p>
<p style="margin-bottom: 0cm; line-height: 100%"> </p>
<p style="margin-bottom: 0cm; line-height: 100%">
For Each oo In
PictureBox1.Children</p>
<p style="margin-bottom: 0cm; line-height: 100%">
If oo Is
PictureBox Then</p>
<p style="margin-bottom: 0cm; line-height: 100%">
I = I + 1</p>
<p style="margin-bottom: 0cm; line-height: 100%">
For x = 1 To I</p>
<p style="margin-bottom: 0cm; line-height: 100%">
If
Mouse.Inside(oo) Then</p>
<p style="margin-bottom: 0cm; line-height: 100%">
If
oo.Mouse.Left Then ' ERROR Not an
object</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Label7.Text = “Got oo”</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Endif</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Endif</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Next</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Endif</p>
<p style="margin-bottom: 0cm; line-height: 100%">
Next</p>
<p style="margin-bottom: 0cm; line-height: 100%">End</p>
<p style="margin-bottom: 0cm; line-height: 100%">Or with
this I get
the error. No mouse event data in Fmain 41<br>
</p>
<p style="margin-bottom: 0cm; line-height: 100%">If
Mouse.Left(oo)
Then ' ERROR No mouse event data in Fmain 41<br>
</p>
<div style="margin-bottom: 0cm; line-height: 100%">
Label7.Text =
“Got oo”</div>
<div style="margin-bottom: 0cm; line-height: 100%">Endif</div>
</div>
<div style="margin-bottom: 0cm; line-height: 100%"><br>
</div>
<div style="margin-bottom: 0cm; line-height: 100%"
dir="ltr" data-setdir="false">Regards</div>
<div style="margin-bottom: 0cm; line-height: 100%"
dir="ltr" data-setdir="false">Mike</div>
<br>
</div>
<div><br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">
----[ <a class="moz-txt-link-freetext" href="http://gambaswiki.org/wiki/doc/netiquette">http://gambaswiki.org/wiki/doc/netiquette</a> ]----
</pre>
</blockquote>
<br>
</body>
</html>