|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
code to find all dynamic control locations on a form???Hi guys,
I have a selection of dynamically created controls on a form. I want to be able to check the location of any of these controls and comare them with the location of another control. (This is actually to replicate the windows desktop drag-drop functionality). As an example I need something like: If me.Controls.(??any control location????) = theButton.Location Any ideas how i can do this.... Marc wrote:
> Hi guys, Not quite sure what you're asking here...> > I have a selection of dynamically created controls on a form. I want to > be able to check the location of any of these controls and comare them > with the location of another control. > (This is actually to replicate the windows desktop drag-drop > functionality). > > As an example I need something like: > > If me.Controls.(??any control location????) = theButton.Location > > Any ideas how i can do this.... You have some controls and you want to compare the location of any of these controls to the locations of all the other controls? The Location property of the control has an X and Y property which should help... exactly how do you want to compare the controls? Its ok..i worked it out
For Each ctrl As Control In Me.Controls If TypeOf ctrl Is Button And ctrl IsNot theButton And ctrl.Location = theButton.Location Then MsgBox("jijj") End If Next End If lord.zol***@gmail.com wrote: Show quoteHide quote > Marc wrote: > > Hi guys, > > > > I have a selection of dynamically created controls on a form. I want to > > be able to check the location of any of these controls and comare them > > with the location of another control. > > (This is actually to replicate the windows desktop drag-drop > > functionality). > > > > As an example I need something like: > > > > If me.Controls.(??any control location????) = theButton.Location > > > > Any ideas how i can do this.... > > Not quite sure what you're asking here... > You have some controls and you want to compare the location of any of > these controls to the locations of all the other controls? > > The Location property of the control has an X and Y property which > should help... > exactly how do you want to compare the controls? Something like this:
If Button1.Bounds.IntersectsWith(Button2.Bounds) Then Debug.WriteLine("Yep") End If <lord.zol***@gmail.com> wrote in message Show quoteHide quote news:1165264587.784878.317400@f1g2000cwa.googlegroups.com... > > Marc wrote: >> Hi guys, >> >> I have a selection of dynamically created controls on a form. I want to >> be able to check the location of any of these controls and comare them >> with the location of another control. >> (This is actually to replicate the windows desktop drag-drop >> functionality). >> >> As an example I need something like: >> >> If me.Controls.(??any control location????) = theButton.Location >> >> Any ideas how i can do this.... > > Not quite sure what you're asking here... > You have some controls and you want to compare the location of any of > these controls to the locations of all the other controls? > > The Location property of the control has an X and Y property which > should help... > exactly how do you want to compare the controls? > Thanks I did not know this one.
Cor Show quoteHide quote "Mudhead" <noth***@yourhouse.com> schreef in bericht news:OvSD4V%23FHHA.4652@TK2MSFTNGP04.phx.gbl... > Something like this: > > If Button1.Bounds.IntersectsWith(Button2.Bounds) Then > Debug.WriteLine("Yep") > End If > > > <lord.zol***@gmail.com> wrote in message > news:1165264587.784878.317400@f1g2000cwa.googlegroups.com... >> >> Marc wrote: >>> Hi guys, >>> >>> I have a selection of dynamically created controls on a form. I want to >>> be able to check the location of any of these controls and comare them >>> with the location of another control. >>> (This is actually to replicate the windows desktop drag-drop >>> functionality). >>> >>> As an example I need something like: >>> >>> If me.Controls.(??any control location????) = theButton.Location >>> >>> Any ideas how i can do this.... >> >> Not quite sure what you're asking here... >> You have some controls and you want to compare the location of any of >> these controls to the locations of all the other controls? >> >> The Location property of the control has an X and Y property which >> should help... >> exactly how do you want to compare the controls? >> > >
App.Config Recovers automatically
PrintPreview Control Function with Two Values Context Menu Not Closing Consume webservice within intranet from internet Command Line Arguments Add items with value and text to a combobox Clear spaces between tex Problem using serial port in vb2005 word automation active document copy |
|||||||||||||||||||||||