|
-
Feb 4th, 2011, 10:40 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Moving a line on a form using HSscrollbar
Hi everyone, trying to move a lineshape (line), across or down my form, but not having any luck with it, I think it is something like this, (but it not quite right)
Can any please help on this one??
LineShape1.X1 & LineShape1.X2 = val (HScrollBar1.Value)
Thanks
-
Feb 4th, 2011, 11:24 AM
#2
Re: [RESOLVED] Moving a line on a form using HSscrollbar
Hi...
Try this:
vb.net Code:
Public Class Form1
Dim myX1 As Integer
Dim myX2 As Integer
'~~~ When scrolling the HScrollBar, we'll add new scroll value to the original (X1 & X2)
Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
LineShape1.X1 = myX1 + HScrollBar1.Value
LineShape1.X2 = myX2 + HScrollBar1.Value
End Sub
'~~~ We are storing the actual position(X1 & X2) of line during the loading time
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
myX1 = LineShape1.X1
myX2 = LineShape1.X2
End Sub
End Class
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|