Separation

xiaoxiao2021-03-06  43

'The following is a class code, which is called in the corresponding position in the form when used.

Option expedition

Private myform as form 'Application Form

Private PICP as Object 'as a partition control

Private ObjBox1 As Object 'Division Left Control

Private ObjBox2 As Object 'Separation Right Control

Private sub coplass_terminate ()

Set myform = Nothing

SET PICP = Nothing

Set objBox1 = Nothing

Set objBox2 = Nothing

End Sub

Public Sub Myinit (Inform As Form, Pic As Object, Obj1 As Object, Obj2 As Object)

ON Error Goto Err1

'Initialize each control position

Set myform = inform

SET PICP = PIC

Set objBox1 = Obj1

Set objBox2 = Obj2

Picp.mousepointer = 9

Picp.appearance = 0

Picp.backcolor = & h8000000f

Picp.Borderstyle = 0

Picp.width = 50

ObjBox1.top = 0

ObjBox1.Left = 0

ObjBox1.width = 3000

ObjBox1.height = myform.height

Picp.top = 0

Picp.Left = ObjBox1.width

Picp.height = myform.height objBox2.top = 0

ObjBox2.Left = ObjBox1.width Picp.width

ObjBox2.height = myform.height

ObjBox2.width = myform.width - ObjBox1.width - Picp.width

Picp.zorder (0)

EXIT SUB

Err1:

End Sub

Public Sub MyMouseMove (MouseButton As Integer, x as single)

ON Error Goto Err1

'Tune in the MouseMove event of the PICP control

If MouseButton = 1 THEN

Picp.Move Picp.Left X

Picp.zorder (0)

END IF

EXIT SUB

Err1:

End Sub

Public Sub MyMouseUp (MouseButton as Integer)

ON Error Goto Err1

'Tune in the MouseUp event of the PICP control

If MouseButton = 1 THEN

ObjBox1.Left = 0

IF Picp.left <1000 Then

ObjBox1.width = 1000

Picp.Left = 1000

Else

IF Picp.Left> MyForm.width Then

ObjBox1.width = MyForm.width - 1000

Picp.Left = ObjBox1.width

Else

ObjBox1.width = Picp.Left

END IF

END IF

ObjBox2.Left = ObjBox1.Width Picp.widthobjBox2.width = myform.width - ObjBox1.width - Picp.width

END IF

EXIT SUB

Err1:

End Sub

转载请注明原文地址:https://www.9cbs.com/read-72800.html

New Post(0)