Hello,
Need a little help on this code:
IF ($_.Button -eq 'Left')
{
$CurTopNow = $panel259.Top
$CurLeftNow = $panel259.Left
$panel259.Top = [System.Windows.Forms.Cursor]::Position.X + $CurTopNow
$panel259.Left = [System.Windows.Forms.Cursor]::Position.Y + $CurLeftNow
}
I have a panel on a form that I'd like to move. So far I've tried above code, but can't determine as to what to add in MouseMove event so it moves smoothly.
Thanks heaps!
Nirmal
MouseMove
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: MouseMove
Here is an example of how to use the event. You need to establish capture and dragging states.
http://www.codeproject.com/Articles/318 ... at-runtime
http://www.codeproject.com/Articles/318 ... at-runtime
Re: MouseMove
Here is a PowerShell Studio demo of moving a control with the mouse;
- Attachments
-
- Demo-ControlMover.psf
- (20.04 KiB) Downloaded 221 times
Re: MouseMove
Demo of movable controls a circular button.
- Attachments
-
- Demo-ControlTricks.psf
- (20.73 KiB) Downloaded 207 times