以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  为什么Line的右端锚定属性不起作用  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=60752)

--  作者:jiangxun
--  发布时间:2014/11/30 17:52:00
--  为什么Line的右端锚定属性不起作用
 ctl = e.Form.CreateControl("LineRH" & e.form.controls("LineRH_number").text, ControlTypeEnum.line)
ctl.ThickNess = 4
ctl.LineColor = Color.SteelBlue
ctl.width = 60
ctl.Height = 4
ctl.anchor = Windows.Forms.AnchorStyles.Top Or Windows.Forms.AnchorStyles.Right

If ctl IsNot Nothing Then
Dim body As object = e.Form.controls("pnl_body")

ctl.Left = 100
ctl.Top = 100

body.AddControl(ctl)
End If

上述代码没有起到右端锚定的作用,请指教


--  作者:有点甜
--  发布时间:2014/11/30 17:55:00
--  
 测试,木有问题,始终和右边保存相同的距离
--  作者:jiangxun
--  发布时间:2014/11/30 18:25:00
--  

Line没有right属性吗,现在只要创建Line就得使用left,top属性,如果有right和bottom属性,就可以在动态改变width情况下线的右点始终不动,现在改变线的宽度线的左点始终不动


--  作者:有点甜
--  发布时间:2014/11/30 19:04:00
--  
改变宽度的时候,你同时改变left不就行了?
--  作者:jiangxun
--  发布时间:2014/11/30 19:18:00
--  

但是当鼠标活动范围超过右边原来线段的右端点位置时,鼠标折返向“左”运动“起始点”就变了,变成“折返点”开始向左移动left了


--  作者:有点甜
--  发布时间:2014/11/30 19:24:00
--  

 为什么一定要用线段控件,直接用gdi画线不行?头尾各放一个控件

 

 http://www.foxtable.com/help/topics/1482.htm

 


--  作者:jiangxun
--  发布时间:2014/11/30 20:51:00
--  

那还需要paint控件吗

 


--  作者:有点甜
--  发布时间:2014/11/30 20:54:00
--  
 不需要,直接用 e.Form.Panel.CreateGraphics
--  作者:jiangxun
--  发布时间:2014/11/30 20:57:00
--  
e.Form.Panel.CreateGraphics (“pn”)
--  作者:jiangxun
--  发布时间:2014/11/30 20:58:00
--  
是这样吗