2,723
社区成员
发帖
与我相关
我的任务
分享
*--vfp版本:vfp9.0(SP2 7423)
Public oform1
oform1=Newobject("form1")
oform1.Show
Return
Define Class form1 As Form
Top = 6
Left = 10
Height = 403
Width = 448
DoCreate = .T.
Caption = "by:十豆三(表单分隔条示例)"
Name = "Form1"
Add Object container1 As Container With ;
Anchor = 7, ;
Top = 2, ;
Left = 2, ;
Width = 133, ;
Height = 399, ;
SpecialEffect = 1, ;
BackColor = Rgb(200,200,255), ;
Name = "Container1"
Add Object list1 As ListBox With ;
Anchor = 14, ;
Height = 63, ;
Left = 143, ;
Top = 338, ;
Width = 301, ;
ItemBackColor = Rgb(150,255,150), ;
Themes = .F., ;
Name = "List1"
Add Object grid1 As Grid With ;
Anchor = 15, ;
Height = 332, ;
Left = 143, ;
Top = 2, ;
Width = 303, ;
BackColor = Rgb(255,200,200), ;
Name = "Grid1"
Add Object shape1 As Shape With ;
Top = -12, ;
Left = 136, ;
Height = 448, ;
Width = 7, ;
Anchor = 7, ;
BorderStyle = 1, ;
MousePointer = 9, ;
SpecialEffect = 0, ;
BackColor = Rgb(0,255,255), ;
Name = "Shape1"
Procedure shape1.Init
This.Move(This.Left,-10,This.Width,Thisform.Height+20)
Endproc
Procedure shape1.MouseMove
Lparameters nButton, nShift, nXCoord, nYCoord &&系统代码
If (nButton=1 And Thisform.CurrentX#0) And (Thisform.CurrentX<>nXCoord) And Between(nXCoord,40,Thisform.Width-40) && nButton=1 只允许鼠标左键移动,Between 是移动范围
This.Left=This.Left+(nXCoord-Thisform.CurrentX)
Thisform.Container1.Width=Thisform.Container1.Width+(nXCoord-Thisform.CurrentX)
Thisform.Grid1.Move(Thisform.Grid1.Left+(nXCoord-Thisform.CurrentX),Thisform.Grid1.Top,Thisform.Grid1.Width-(nXCoord-Thisform.CurrentX))
Thisform.List1.Move(Thisform.List1.Left+(nXCoord-Thisform.CurrentX),Thisform.List1.Top,Thisform.List1.Width-(nXCoord-Thisform.CurrentX))
Thisform.CurrentX=nXCoord
Endif
Endproc
Procedure shape1.MouseDown
Lparameters nButton, nShift, nXCoord, nYCoord &&系统代码
If nButton=1 && 只允许鼠标左键移动
Thisform.CurrentX=nXCoord && 只记录水平位置,也就是只能左右移动。
Endif
Endproc
Enddefine