Bind Object Location

tishri

New member
Joined
Feb 22, 2008
Messages
3
Programming Experience
5-10
Hi everyone,

I would like to know if its possible to bind the property LOCATION of an object like button.

Like:
FORM LOAD
button1.location = new location(hscrollbar1.value,vscrollbar1.value)

So that, every time I move either the hscrollbar1 or vscrollbar1 the button1.location will change or moves the object to the location of hscrollbar1.value and vscrollbar1.value. It should happen without setting its value using the SCROLL EVENT.

Thanks..
 
private sub form_load(arguments) handles form.load
button1.bounds.location = new location(hscrollbar1.value,vscrollbar1.value)
end sub

The above function doesn't really bind to the properties of the scroll bar values.

I want to move the location of the object like button using the hscrollbar1.value and vscrollbar1.value without calling/notifying them using hscrollbar1_scroll/vscrollbar1_scroll( scroll handler) .

Please if you could suggest a way to do this. I'm doing this because I will be handling multiple objects to be moved to there specific location without iterating to each object and setting there location(x,y) values. Which I think would be a very slow process.

I'm doing this for a gantt chart project. I want to make a gantt chart that has buttons(schedules) to be moved/dragged inside the chart. If you could suggest a way to do this please give me some idea.

thanks
 
VB.NET:
Me.Button1.DataBindings.Add("Left", Me.HScrollBar1, "Value")
Me.Button1.DataBindings.Add("Top", Me.VScrollBar1, "Value")
 
Back
Top