以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]添加PNL的MOUSEMONE事件 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=116339) |
-- 作者:blsu33 -- 发布时间:2018/3/23 9:01:00 -- [求助]添加PNL的MOUSEMONE事件 老师, 不知为何添加事件提示错误
|
-- 作者:有点甜 -- 发布时间:2018/3/23 9:28:00 -- 注意红色代码
Dim obj As Windows.Forms.TextBox = Forms("").Controls("").BaseControl |
-- 作者:blsu33 -- 发布时间:2018/3/23 9:45:00 -- 老师 再给看看 str &= "forms(""atbset"").Controls(""pnl-body"").ClearControl" & vbcrlf str &= "Dim pnl_cz" & "_" & ymname & "_" & ymname & " As WinForm.Panel=forms(""atbset"").CreateControl(""" & "pnl_cz" & "_" & ymname & "_" & ymname & """,ControlTypeEnum.panel)" & vbcrlf str &= "Dim obj As Windows.Forms.Panel=forms(""atbset"").Controls("""& "pnl_cz" & "_" & ymname & "_" & ymname & """).BaseControl" & vbcrlf str &= "AddHandler obj.MouseMove,AddressOf za_btn_Mousemove" & vbcrlf str &= "AddHandler obj.mouseup,AddressOf za_btn_mouseup" & vbcrlf str &= "AddHandler obj.MouseDown,AddressOf za_btn_MouseDown" & vbcrlf
|
-- 作者:blsu33 -- 发布时间:2018/3/23 9:47:00 -- Public Sub za_btn_MouseDown(sender As System.Object, e As System.EventArgs) Functions.Execute("za_btn_MouseDown", sender,e) End Sub Public Sub za_btn_MouseMove(sender As System.Object, e As System.EventArgs) Functions.Execute("za_btn_MouseMove", sender,e) End Sub Public Sub za_btn_MouseUp(sender As System.Object, e As System.EventArgs) Functions.Execute("za_btn_MouseUp", sender,e) End Sub |
-- 作者:有点甜 -- 发布时间:2018/3/23 9:48:00 -- 不同事件,定义不同,参考
https://msdn.microsoft.com/zh-cn/library/system.windows.forms.control.mousemove(v=vs.110).aspx
|
-- 作者:blsu33 -- 发布时间:2018/3/23 11:34:00 -- 哦 已经改全局代码了 还是有点问题 .NET Framework 版本:2.0.50727.8794 Foxtable 版本:2018.3.9.1 错误所在事件:自定义函数za_btn_MouseUp 详细错误信息: 调用的目标发生了异常。 重载决策失败,必须进行收缩转换才能调用 Public“Min”: \'Public Shared Function Min(val1 As ULong, val2 As ULong) As ULong\': 与参数“val1”匹配的参数从“String”收缩到“ULong”。 与参数“val2”匹配的参数从“Integer”收缩到“ULong”。 \'Public Shared Function Min(val1 As Long, val2 As Long) As Long\': 与参数“val1”匹配的参数从“String”收缩到“Long”。 \'Public Shared Function Min(val1 As Single, val2 As Single) As Single\': 与参数“val1”匹配的参数从“String”收缩到“Single”。 \'Public Shared Function Min(val1 As Decimal, val2 As Decimal) As Decimal\': 与参数“val1”匹配的参数从“String”收缩到“Decimal”。 \'Public Shared Function Min(val1 As Double, val2 As Double) As Double\': 与参数“val1”匹配的参数从“String”收缩到“Double”。 \'Public Shared Function Min(val1 As UInteger, val2 As UInteger) As UInteger\': 与参数“val1”匹配的参数从“String”收缩到“UInteger”。 与参数“val2”匹配的参数从“Integer”收缩到“UInteger”。 \'Public Shared Function Min(val1 As Byte, val2 As Byte) As Byte\': 与参数“val1”匹配的参数从“String”收缩到“Byte”。 与参数“val2”匹配的参数从“Integer”收缩到“Byte”。 \'Public Shared Function Min(val1 As SByte, val2 As SByte) As SByte\': 与参数“val1”匹配的参数从“String”收缩到“SByte”。 与参数“val2”匹配的参数从“Integer”收缩到“SByte”。 \'Public Shared Function Min(val1 As Short, val2 As Short) As Short\': 与参数“val1”匹配的参数从“String”收缩到“Short”。 与参数“val2”匹配的参数从“Integer”收缩到“Short”。 \'Public Shared Function Min(val1 As Integer, val2 As Integer) As Integer\': 与参数“val1”匹配的参数从“String”收缩到“Integer”。 \'Public Shared Function Min(val1 As UShort, val2 As UShort) As UShort\': 与参数“val1”匹配的参数从“String”收缩到“UShort”。 与参数“val2”匹配的参数从“Integer”收缩到“UShort”。 |
-- 作者:有点甜 -- 发布时间:2018/3/23 12:13:00 -- 1、贴出你写的代码。
2、调用min函数的时候,这样写 min(val(值1), val(值2)) |
-- 作者:blsu33 -- 发布时间:2018/3/23 12:32:00 -- Dim e =args(0) If MouseButton = MouseButtons.Left Then forms("atbset").Controls("pnl_cz_" & vars("childcknamectl") & "_" & vars("childcknamectl")).BaseControl.Refresh Dim g As Graphics = forms("atbset").Controls("pnl_cz_" & vars("childcknamectl") & "_" & vars("childcknamectl")).BaseControl.CreateGraphics g.DrawLine(Pens.Red,val(vars("px")),val(vars("py")),val(e.X),val(vars("py"))) g.DrawLine(Pens.Red,val(vars("px")),val(vars("py")),vars("px"),val(e.Y)) g.DrawLine(Pens.Red,val(e.x),val(vars("py")),val(e.X),val(e.y)) g.DrawLine(Pens.Red,val(vars("px")),val(e.Y),val(e.x), val(e.y)) End If |
-- 作者:blsu33 -- 发布时间:2018/3/23 12:38:00 -- 不改之前 是这样的 .NET Framework 版本:2.0.50727.8794 Foxtable 版本:2018.3.9.1 错误所在事件:自定义函数za_btn_MouseMove 详细错误信息: 调用的目标发生了异常。 重载决策失败,必须进行收缩转换才能调用 Public“DrawLine”: \'Public Sub DrawLine(pen As System.Drawing.Pen, x1 As Integer, y1 As Integer, x2 As Integer, y2 As Integer)\': 与参数“x1”匹配的参数从“String”收缩到“Integer”。 与参数“y1”匹配的参数从“String”收缩到“Integer”。 与参数“y2”匹配的参数从“String”收缩到“Integer”。 \'Public Sub DrawLine(pen As System.Drawing.Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single)\': 与参数“x1”匹配的参数从“String”收缩到“Single”。 与参数“y1”匹配的参数从“String”收缩到“Single”。 与参数“y2”匹配的参数从“String”收缩到“Single”。 代码 Dim e =args(0) If MouseButton = MouseButtons.Left Then forms("atbset").Controls("pnl_cz_" & vars("childcknamectl") & "_" & vars("childcknamectl")).BaseControl.Refresh Dim g As Graphics = forms("atbset").Controls("pnl_cz_" & vars("childcknamectl") & "_" & vars("childcknamectl")).BaseControl.CreateGraphics g.DrawLine(Pens.Red,vars("px"),vars("py"),e.X,vars("py")) g.DrawLine(Pens.Red,vars("px"),vars("py"),vars("px"),e.Y) g.DrawLine(Pens.Red,e.x,vars("py"),e.X,e.y) g.DrawLine(Pens.Red,vars("px"),e.Y,e.x, e.y) End If |
-- 作者:有点甜 -- 发布时间:2018/3/23 12:42:00 -- 把值转换成对应的值
http://www.foxtable.com/webhelp/scr/1513.htm
|