Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving a frame within another frame?(VB6)

Status
Not open for further replies.

STurneruk

Programmer
Oct 18, 2001
4
GB
I have had only limited success in achieving this and would appreciate some pointers on how to move a frame around(up and down , and left and right) using the mouse.
 
Make certain that you first click the edge of the frame with the mouse. This should select the entire frame. You may have to do this a couple of times before you discover where the edge of the frame actually is located. Then when you move the mouse over the frame edge the mouse should change to a hand or a cross-hair, so that you can move it.
 
Do you mean at runtime? If so, try something like this in the keypress event. Text1 holds the movement rate, iMove says moveit not type in it (tx(Index) is an edit box). For size, just change width and height.

L = Text1

If iMove Then
If KeyAscii = 54 Then 'right
TX(Index).left = TX(Index).left + L
ElseIf KeyAscii = 50 Then 'down
TX(Index).top = TX(Index).top + L
ElseIf KeyAscii = 56 Then 'up
TX(Index).top = TX(Index).top - L
ElseIf KeyAscii = 52 Then 'left
TX(Index).left = TX(Index).left - L
End If
KeyAscii = 0
Exit Sub
End If Peter Meachem
peter@accuflight.com
 
Thanks for the replies.

The action required is at runtime. The scenario is this : -
The form displays a listview of rows , each with a checkbox.
When the checkbox is selected the form displays a frame , with text boxes to amend certain columns in the selected row. As the frame 'sits' on top of the list view , it would be useful to be able to click on the frame and move it away.
I have been using 'drag & drop' but this only moves in small increments if at all. Any Ideas??

Thanks
 
Couldn't you then make the list invisible and the frame visible? Peter Meachem
peter@accuflight.com
 
Yes , I could , but I would like to be able to see the content of the listview covered by the frame. Hence the need to be able to move the frame around.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top