Very early binding which gives a performance increase (I know, I know it
won't even be noticeable but I had to give the _correct_ answer first)
Probably more important to some is that casting to the correct interface
then gives you the correct information in the context sensitive drop-downs
in the editor.
--
Terry Kreft
"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:4414ed0c$0$23304$5a62ac22@per-qv1-newsreader-01.iinet.net.au...[color=blue]
> Try:
> Dim myTextBox as TextBox
> Set myTextBox = DropCtl
>
> Anything you can do with a TextBox object, you should also be able to do
> directly with a Control object anyway, so I'm not sure why you would need[/color]
to[color=blue]
> do that.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users -
http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Vincent" <animedreamer@verizon.net> wrote in message
> news:1142220119.885543.148010@i39g2000cwa.googlegr oups.com...[color=green]
> > Regarding the dropdetect function, defined as follows:
> >
> > Sub dropdetect(DropFrm As Form, DropCtrl As Control, Button As Integer,
> > Shift As Integer, X As Single, Y As Single)
> >
> > Is it possible to cast the Control parameter, DropCtrl, to a TextBox
> > object? The underlying control is in fact a textbox which I wish to
> > redraw given the X and Y parameters above. In Java, you could simply
> > declare a TextBox reference and assign it to the Control object as
> > follows:
> >
> > Dim myTextBox as TextBox
> > myTextBox = (TextBox)DropCtrl
> >
> > Is there any analogous code in VBA? Thanks.
> >
> > -Vincent[/color]
>
>[/color]